Hi there,
I’ve written a small benchmark app for OpenGL vs JUCE and would like someone to verify I am doing things correctly. Main points:
JUCE version:
- call repaint() in timerCallback() with startTimerHz(1000) to max out frame speed capability
- call time_frames() in every paint() call.
OpenGL version:
- using setContinuousRepainting(true)
- call time_frames() in every renderOpenGL() call.
void MainComponent::time_frames() { const auto current_time = Time::currentTimeMillis(); frame_count++; if (current_time - prev_time >= 1000.0 ){ frame_time = 1000. / frame_count; DBG(String::formatted("%f ms/frame", frame_time)); frame_count = 0; prev_time = current_time; } }
I’m finding JUCE is capped at around 8.3ms/frame with OpenGL getting around 2.3ms/frame.
The full code can be found here: