Advice on Optimizing UI Performance for Windows

Hello everyone,

We recently ported our app to Windows and encountered a significant slowdown in UI responsiveness compared to the OSx version. The sluggishness is most evident when resizing the window – it feels choppy and unresponsive. Our application involves rendering a considerable amount of text, and thus far, we haven’t relied on OpenGL or any extensive optimization techniques beyond basic culling/clipping, as they weren’t necessary on OSx.

Our team is somewhat perplexed by this issue, considering we chose JUCE for its cross-platform capabilities, yet the performance disparity is quite noticeable. While we’re not expecting any miraculous solutions, I’m keen to hear your thoughts on the best approach to tackle this.

I’ve noticed there’s been some debate about whether implementing OpenGL as the main renderer could actually worsen performance. I’m curious if anyone has experience or insights regarding this?

Additionally, I’ve come across suggestions about offloading rendering to background threads and updating the UI asynchronously. However, this would require substantial refactoring on our part. Before we commit to such an extensive overhaul, are there other viable options or strategies we should consider?

Any advice or shared experiences would be greatly appreciated, as we navigate through these optimization challenges.

We are currently working on significant improvements to the rendering on Windows. See this thread for more info.

1 Like

The fact of encapsulating the components in an OpenGL component speeds up the entire repainting, it seems that it is because it would use its own thread. If you want to test it, this would be the body of the class

class MainComponent  : public juce::OpenGLAppComponent
{
public:
    MainComponent() {
    
    }

    ~MainComponent() {
        shutdownOpenGL();
    }

    void initialise() override {}
    void shutdown() override {}
    void render() override {}
    
    void paint(juce::Graphics& g) override
    {

    }
    void resized() override
    {

    }
};

If this is good or bad practice or there are better solutions, I have no idea, I will follow the thread