Page 1 of 1

Strategies for initialization/optimization

Posted: Fri May 30, 2014 12:48 pm
by greggorob64
I'm loading several charts onto the screen, and its taking up to 1second a piece, which is much higher than i'd like it to be.

I'm wondering if there's any strategies i can take to try to cut this down lower?

*note* this is with a code profiler attached. I know these numbers are overstated because of that.

A few points/questions:

[*]I'd love to unload any type of initialization into the background. My application locking up for 12 seconds while it draws 12 charts is sad. I know the 'new' on the chart has to be done in the gui thread, but does adding series and axis also have to be done in the foreground?

[*] Things like adding a pointlineseries and yaxis are taking upwards of 50ms on my machine to add to the chart. Is there anything i can do to lower the 'complexity' of the controls to make them initialize quicker? Maybe things like turn mouse interaction off?

[*] Any general notes or strategies i can use to speed up the initialization?

Thanks!

Re: Strategies for initialization/optimization

Posted: Fri May 30, 2014 3:26 pm
by ArctionPasi
Sounds really slow...

Before giving more tips, can you check that you have used chart.BeginUpdate...EndUpdate around the initialization. It prevents chart refreshing after every property change, and the final EndUpdate is the one that actually needs to render the chart.

If you are changing any RenderOptions properties, it's best to pass the RenderSettings structure as parameter to LightningChartUltimate constructor instead.

Re: Strategies for initialization/optimization

Posted: Sat May 31, 2014 12:07 pm
by greggorob64
I am using begin and end update. I am generating a lot of graphs In a tab well. Some are standard 2d time domain, some 3d spectrogram, and some 2d

However, all use begin and end update. The 50 ms time comes is when I have ants code profiling enabled, so the time Is overstated.

However, I'm sure I'll looking at a minimum of seconds per chart of setup time

Re: Strategies for initialization/optimization

Posted: Sat May 31, 2014 5:27 pm
by ArctionPasi
I guess that the delay may come from HLSL effects compiling, that 3D surfaces and 2D heatmaps use. Optimizing that would need some restructuring our code.

Would it be possible for you to send me your application (or reduced mock-up), and I can profile it with LightningChart source code and give exact answers. Also please share some info of your computer specs, especially video adapter type and processor model.

Re: Strategies for initialization/optimization

Posted: Mon Jun 02, 2014 2:47 pm
by greggorob64
That would take a significant amount of time; but I probably should. It might be a few weeks; but i'll definitely want to readdress this and i can send you a zipped solution, thanks.

Re: Strategies for initialization/optimization

Posted: Mon Jun 02, 2014 3:03 pm
by ArctionPasi
Great. Meanwhile I'll try to find a time slot to optimize the HLSL compilation time.

Re: Strategies for initialization/optimization

Posted: Thu Jun 05, 2014 5:07 pm
by greggorob64
I took some time to readdress this, and i was able to make it much more manageable, albeit way more complicated.

I'm initializing 15 (for example) lightning charts, each on their own tab.

My order is now this:

call 'new' on 15 usercontrols

using async/await tasks to populate all of my data into the charts, as well as all chart initilization.

Any code that requires operations be done in the gui thread I use control.invoke. This allows to use LINQ asParalel as well, to leverage as much of the cpu as possible.

The time is now magnitudes faster.

Re: Strategies for initialization/optimization

Posted: Thu Jun 19, 2014 12:45 pm
by ArctionPasi
We have improved the Intensity, Surface, Persistent intensity layers and multi-colored line charts initialization time in v.6.0.6 assembly pack. When HLSL effects compilation took up to several seconds, now it's only 10-20 ms.

We have also improved the rendering performance of these a lot.

Please give it a try :D