Jump to content
Software FX Community

Performance degradation of CFX98 for plots


User (Legacy)
 Share

Recommended Posts

Hi

WinNT4SP5, Pentium III 300MHz 256 Mb RAM, Borland C++ builder V. 3.

I am using ChartFX98 for plotting results from an ecosystem model we are

developing. I have found that the plotting speed degrades as the plotting

proceeds. For 5000 points, 2 series, in a trivial sample app we developed to

illustrate the problem, the time in miliseconds taken to plot the points is

(in 500 point batches):

5417

7761

9724

11616

12589

13950

15913

17715

18747

Even if we turn off message processing in the app, so the points are only

displayed at the end of the plot (which we do not want), the numbers are

(for 10 series, each with 5000 points)

80

200

341

450

591

771

1032

1522

2323

I am very worried about this, since we have invested a substantial amount of

time (and money) in ChartFX as the graphics solution for this application.

I have taken the liberty of copying in a little code below.

Many thanks for help/comments.

regards

J.G.Ferreira

1. Function which loops thru points

for(int i=0; i < Samples->Count; i++)

{

SampleForm = (TForm1 *)Samples->Items[i];

if(SampleForm==NULL) continue;

SampleForm->AddPoint();

Application->ProcessMessages();

}

while ( Mode==STOP)

Application->ProcessMessages();

if(Mode == RESET)

break;

// if (r % 50 == 0)

Application->ProcessMessages();

2. Function which calls CFX API

void __fastcall TForm1::AddPoint()

{

long tickVal2;

if(tickVal1 == 0)

tickVal1 = GetTickCount();

if(PointIndex == 0)

CFX->OpenDataEx(COD_XVALUES, SeriesCount, 1);

else

CFX->OpenDataEx(COD_XVALUES | COD_ADDPOINTS, SeriesCount, 1);

for(int s=0; s < SeriesCount; s++)

{

CFX->XValueEx[s][PointIndex] = PointIndex;

CFX->ValueEx[s][0] = (s+1) * 10;

CFX->ValueEx[s][0] = (s+1) * 10;

}

CFX->CloseData(COD_XVALUES | COD_SMOOTH | COD_REALTIME);

if(PointIndex > 0 && (PointIndex % 500) == 0)

{

tickVal2 = GetTickCount();

Memo1->Lines->Add(IntToStr(tickVal2 - tickVal1));

tickVal1 = 0;

}

PointIndex ++;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...