Poor performance when debugger attached

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

Max E.
Posts: 6
Joined: Thu Apr 27, 2017 1:15 pm

Poor performance when debugger attached

Post by Max E. » Thu Apr 27, 2017 1:22 pm

Hi,

I noticed that the performance of the chart (XY-view) is extremely poor when the Visual Studio debugger is attached to the process. The application responds in a very laggy way and ultimately freezes. As soon as I detach the debugger, the chart runs as smoothly as expected.

I only experience this behaviour with LC version 8.0.1.4001. An older version of our application uses LC version 7.0.2.4018. With that version I don't have this issue.

Appreciate your help

Max

ArctionKestutis
Posts: 386
Joined: Mon Mar 14, 2016 9:22 am

Re: Poor performance when debugger attached

Post by ArctionKestutis » Fri Apr 28, 2017 7:41 am

Hi Max,

The attached Visual Studio debugger will always affect performance. How big is an effect depend on complexity of program and workflow.
What application you are testing? Is it simple few point-line series with several hundred of points or real-time monitoring app with hundred thousands points per second? For example, our Demo App example "Audio L+R, area, spectrogram" was always very sluggish with debugger attached. However, then I tested it today with latest version v8, I got very good/smooth performance (with debugger).

So here is that you can do to solve your 'debugger problem':
* update to latest LightningChart available
* check for ideas to improve the debugging experience here: https://blogs.msdn.microsoft.com/visual ... al-studio/
* if it is specific to your app, please send it Arction's support email.

Hope this helps.

Max E.
Posts: 6
Joined: Thu Apr 27, 2017 1:15 pm

Re: Poor performance when debugger attached

Post by Max E. » Thu May 04, 2017 2:43 pm

Hi,

in the case I described I had ten PointLineSeries with a few hundred data points each. New points are added with a frequency of 10Hz. I really don't think that my performance problem is the regular performance loss that comes when a debugger is attached, because the chart isn't responding any more when only a few thousand points are displayed. With version 7.0.2.4018, we could draw dozens of millions of points without a problem, even if the debugger is attached.

Meanwhile I noticed something else of which I am sure it has to do with my problem:

If I take our application and link LC version 8.0.1.4001 to it, the chart throws a first-chance exception (it is thrown and caught somewhere in the LC) when the deployment key is set:
<Picture removed by moderator>

Every time new points are added, an OverflowException (first chance) is thrown:
Exception on EndUpdate.jpg
Exception on EndUpdate.jpg (83.15 KiB) Viewed 10580 times
This has nothing to do with my machine or the debugger. If I run the application on an arbitrary machine and use perfmon.exe, I can see that the application throws around 100 first-chance-exceptions per second.

If I take exactly the same code and link it to LC version 7.0.2.4018, no exceptions occur and the performance is as expected.

I cannot send you my application, it has tons of dependencies, but I can provide you with logs, dumpfiles and so on if you tell me what you need to track down this issue.

Thanks
Max

ArctionKestutis
Posts: 386
Joined: Mon Mar 14, 2016 9:22 am

Re: Poor performance when debugger attached

Post by ArctionKestutis » Fri May 05, 2017 12:16 pm

Hi Max,

I perfectly understand your frustration when application stopped working after update. Unfortunately it is two ways process: not only LightningChart needs update, but also customer code need adaptation. We not braking anything on purpose, just changes we introduce may have some Backwards compatibility issues. Please note, the latest version is 8.0.2.4001.
It seems that in your post you mixed several problems. Therefore, I would still encourage you to contact Action's support through email that we could piece things together. As for now, I see three problems:

1. Poor performance when debugger attached.
- If you could not send your app, please test our Demo App. Example "Thread-fed multi-channel data" looks very similar to your app (based on description). Example could be configured to have different sampling rate, number of channels and xAxis length. Do you have problem with it?

2. The deployment key problem.
- The license system change is probably the biggest change in V8 compare to v7.2. Please read carefully User's Manual section 4. The deployment procedure is very different from v7. Call the SetDeploymentKey methods somewhere before the components need to be used (chapter 4.4). From your screenshot I see that call come after LightningChart construct.

3. OverflowException with Add Points method.
- Is it PointLineSeries.AddPoints() method? Could you send the excerpt of code how points are added and chart's update called?

All the best,
Kestutis

Max E.
Posts: 6
Joined: Thu Apr 27, 2017 1:15 pm

Re: Poor performance when debugger attached

Post by Max E. » Fri May 05, 2017 1:37 pm

Hi Kestutis,

thanks for your tips. Regarding Problem No. 2, I tried what you suggested and set the deployment key before the control is created, but still get this Exception:
Exception Deployment Key.jpg
Exception Deployment Key.jpg (98.53 KiB) Viewed 10574 times
Regards

Max

ArctionKestutis
Posts: 386
Joined: Mon Mar 14, 2016 9:22 am

Re: Poor performance when debugger attached

Post by ArctionKestutis » Fri May 05, 2017 1:54 pm

Did you copied correct key? You need to press Copy deployment key to Clipboard button (not ‘Copy key to Clipboard’)?
What are the exception details? Stack trace?

Max E.
Posts: 6
Joined: Thu Apr 27, 2017 1:15 pm

Re: Poor performance when debugger attached

Post by Max E. » Fri May 05, 2017 2:46 pm

You are right, I accidentially used the key in my previous post, not the deployment key. I tried again, and I double checked, I'm using the deplayment key now. The excepion still occurs:
Exception in Main.jpg
Exception in Main.jpg (225.28 KiB) Viewed 10572 times
These are the details:
System.Exception occurred
HResult=-2146233088
Message=Eine Ausnahme vom Typ "System.Exception" wurde ausgelöst.
Source=Arction.Licensing
StackTrace:
bei A.c1c85a5594c49c246fa974974de9e6823.c9a3fb9dcdd40fcbeff1924aa16f74434(String c812cb451be1167ddf506866cab568a95, String c7797435748f2246900b453934b21be71)
InnerException:
Exception details.jpg
Exception details.jpg (254.47 KiB) Viewed 10572 times

Max E.
Posts: 6
Joined: Thu Apr 27, 2017 1:15 pm

Re: Poor performance when debugger attached

Post by Max E. » Fri May 05, 2017 2:54 pm

I created a sample project and a video that demonstrates Problem No. 3, but I cannot upload it here because the files are too big. Can you give me an e-mail address to which I can send them?

ArctionKestutis
Posts: 386
Joined: Mon Mar 14, 2016 9:22 am

Re: Poor performance when debugger attached

Post by ArctionKestutis » Mon May 08, 2017 10:22 am

Please send to support(at)arction.com That is primary channel of support :D

ArctionKestutis
Posts: 386
Joined: Mon Mar 14, 2016 9:22 am

Re: Poor performance when debugger attached

Post by ArctionKestutis » Tue May 09, 2017 8:13 am

Most likely this is the “Axis’ range-change” bug. Under some conditions major tick count reaches several millions, and this cause out of memory exception and other problems. The issue was fixed in v8.0.2.1.