Hi,

Mark Wilson wrote:
> Hi Werner,
> 
> Thanks for your attention to this.  I'm working on a Solaris box using 
> the default Sun video card (don't know much about it's capabilities, but 
> I can probably find out), with the plplotcanvas.  One reason we want to 
> use the canvas (which is just fine for 95% of our apps in term of speed) 
> is that we can easily integrate it into our Gtk GUI's, say in a frame or 
> on a notebook page or whatever.  It is my understanding that the xwin 
> driver would pop the graph up in a separate window, which isn't ideal in 
> our environment for various reasons.   I suppose if we can tell the xwin 
> driver what X window ID to use, that may work...

You could first try to unbeautify plplot_canvas. First be sure that you 
don't use freetype (which is nice but slow) with this function (I believe):

void plplot_canvas_use_text(PlplotCanvas* self,gboolean use_text)

Next, you have to hack the plplot code, check the following function in 
bindings/gnome2/lib/plplotcanvas.c

PlplotCanvas* plplot_canvas_new() {

   PlplotCanvas *canvas;

   canvas = PLPLOT_CANVAS(g_object_new(PLPLOT_TYPE_CANVAS,"aa",TRUE,NULL));

   plplot_canvas_devinit(canvas);

   return canvas;
}

I don't know gnome, but I believe >> "aa",TRUE, << means antialized 
output - turn this off with >> "aa",FALSE, << - and recompile plplot 
library. I might actually be totally wrong, but maybe someone who knows 
can comment on this.

But I believe using plplot_canvas_use_text should make the output 
already considerably faster.

Regards,
Werner

> 
> Mark
> 
> 
> 
> Werner Smekal wrote:
>> Hi Mark,
>>
>> just because I was curious I wrote a little program, which does some 
>> easy calculation and plots 1000 graphs. On Windows (Pentium M 1733Mhz) 
>> I achieved framerates from 280FPS (wxWidgets driver) to 530 FPS 
>> (wingcc) driver (using -drvopt text=0 to disable antialized text). The 
>> xwin driver might even be faster on Linux. Anyway, as long as you 
>> don't have surface plots, I can't see any problems even for 
>> complicated lineplots.
>>
>> So to answer your question - plplot performance should be good enough 
>> for 5Hz plots.
>>
>> HTH,
>> Werner
>>
>>
>> #include <time.h>
>> #include <math.h>
>>
>> #include "plplot.h"
>>
>> #define PC_e        1.60217653e-19           /* elementary charge e 
>> [C] */
>> #define PC_me       9.1093826e-31            /* mass of electron me 
>> [kg] */
>>
>> #define NP 1001 /* number of points */
>> #define MAX(a, b) ((a)<(b)?(b):(a))
>> #define MIN(a, b) ((a)<(b)?(a):(b))
>>
>> int main( int argc, char *argv[] )
>> {
>>   PLFLT x[NP], y[NP];
>>   PLFLT xmin, xmax;
>>   PLFLT ymin=1e30, ymax=1e-30;
>>   PLFLT r_c;
>>   size_t i,counter;
>>   clock_t watch;
>>   float duration;
>>
>>   plparseopts( &argc, argv, PL_PARSE_FULL );
>>   plinit();
>>   plspause(0);
>>
>>   watch=clock();
>>   for(counter=0; counter<1000; counter++) {
>>     xmin=0.0001;
>>     xmax=0.0020+counter/50.0;
>>     r_c=0.02;  /* maximum cyclotron radius */
>>     for( i=0; i<NP; i++ ) {
>>       x[i] = (xmax-xmin)*i/NP+xmin;
>>       y[i] = (pow(x[i]*PC_e*r_c, 2.0)/2.0/PC_me)/PC_e;
>>       ymin=MIN( ymin, y[i] );
>>       ymax=MAX( ymax, y[i] );
>>     }
>>
>>     plcol0( 1 );
>>     plenv( xmin, xmax, ymin, ymax, 0, 0 );
>>     plcol0( 2 );
>>     pllab( "Magnetic field [T]", "Energy [eV]", "Energy Range");
>>
>>     plcol0( 3 );
>>     plline( NP, x, y );
>>   }
>>   duration=(float)(clock()-watch)/CLOCKS_PER_SEC;
>>   printf("%f sec, FPS %f\n", duration, 1000.0/duration );
>>
>>   /* Don't forget to call plend() to finish off! */
>>   plend();
>>   exit(0);
>> }
>>
>>
>>
>> Mark Wilson wrote:
>>> Hello,
>>>
>>> We need to update a graph at about a 5Hz rate, and the
>>> plplot canvas doesn't seem able to keep up with that
>>> (takes 200 to 300 ms to update graph). I'm wondering if
>>> this is something to be expected, or if we're doing
>>> something wrong (I don't expect anyone to tell me what I
>>> may or may not be doing wrong, I'm just looking for
>>> general info on performance).
>>>
>>> Thanks,
>>> Mark
>>>
>>> ------------------------------------------------------------------------- 
>>>
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to 
>>> share your
>>> opinions on IT & business topics through brief surveys - and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV 
>>>
>>> _______________________________________________
>>> Plplot-general mailing list
>>> Plplot-general@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/plplot-general
>>
>>


-- 
Dipl. Ing. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
        +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to