question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance drops as window size increases

See original GitHub issue

Bug Report Template

ScottPlot Version: 4.1.15

Operating System: Windows 10 x64

Application Type: WinForms

Bug Description: I have a Plot containing 4 SignalPlots each with <200,000 data points. The FormsPlot is docked to fill the window, as the window size (and therefore the FormsPlot size) is increased the rendering becomes slower. When the FormsPlot is 1238x498 the render time is ~60ms, when resized to 3822x1840 render time goes up to ~700ms. I assume this isn’t normal. Your 5 million point demo doesn’t seem to exhibit this behaviour.

Reproducing: Simple example below, but without the 18mb of data (in serialised xml format), I can upload this if it helps


// simple winform with FormsPlot object docked to fill window
        double[][] data = new double[4][];
        string[] yLabels = new string[] { "-2000", "", "0", "", "2000", "-2000", "", "0", "", "+2000", "-200", "", "0", "", "+200", "-200", "", "0", "", "+200" };
        double[] yLabelPos = new double[] { -200, -100, 0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700 };

        private void Form1_Load(object sender, EventArgs e) {
            System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(data.GetType());
            System.IO.TextReader reader = new System.IO.StreamReader(@"c:\temp\data.xml");
            data = (double[][])x.Deserialize(reader);

            for (int i = 0; i < data[0].Length; i++) {
                data[2][i] /= 10;
                data[3][i] /= 10;
            }

            SignalPlot sp = formsPlot1.Plot.AddSignal(data[0], 200);
            sp.OffsetY = 1500;
            sp = formsPlot1.Plot.AddSignal(data[1], 200);
            sp.OffsetY = 1000;
            sp = formsPlot1.Plot.AddSignal(data[2], 200);
            sp.OffsetY = 500;
            sp = formsPlot1.Plot.AddSignal(data[3], 200);
            sp.OffsetY = 0;
            formsPlot1.Plot.YTicks(yLabelPos, yLabels);
            formsPlot1.Plot.SetAxisLimitsY(-300, 1800);
        }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
raburtoncommented, May 31, 2021

Ok, thanks for looking in to this for me. I’ll probably start with the graph zoomed in instead of fully zoomed out then. If people want to zoom all the way out they’ll probably expect it to slow down, rather than starting slow and getting faster as they zoom in. I’ll try the render queue option as well.

0reactions
swhardencommented, May 30, 2021

Activating the render queue will render in another thread and not block the UI thread while interacting with the mouse. It probably won’t increase the framerate, but it may make your application feel smoother. Worth a try!

formsPlot1.Configuration.UseRenderQueue = true;
Read more comments on GitHub >

github_iconTop Results From Across the Web

frame rate decreases when increasing window size
frame rate decreases when increasing window size · Decrease the resolution, you can do this in the menu regardless if fullscreen or not,...
Read more >
Why does my FPS drop when I go into maximized ...
This happens because the computer has to render more pixels on your screen. When the window is smaller the computer has to process...
Read more >
three.js - Why does fps drop when increasing the scale of ...
It's definitely normal. A larger plane cover more surface on the screen, thus more pixels. More fragments are emitted by the rasterisation ...
Read more >
Does increasing TCP window size have an effect on ...
In this case, increasing the window size will increase performance until that characteristic amount is reached, or slightly exceeded.
Read more >
Windows scaling issues for high-DPI devices
Discusses Windows scaling issues for high-DPI devices. Provides resolutions and workarounds for various scenarios.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found