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!
Strategies for initialization/optimization
Moderator: Queue Moderators
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Strategies for initialization/optimization
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.
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.
LightningChart Support Team, PT
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
Re: Strategies for initialization/optimization
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
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
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Strategies for initialization/optimization
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.
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.
LightningChart Support Team, PT
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
Re: Strategies for initialization/optimization
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.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Strategies for initialization/optimization
Great. Meanwhile I'll try to find a time slot to optimize the HLSL compilation time.
LightningChart Support Team, PT
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
Re: Strategies for initialization/optimization
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.
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.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Strategies for initialization/optimization
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
We have also improved the rendering performance of these a lot.
Please give it a try
LightningChart Support Team, PT