Rendering improvements - #1915
Merged
Merged
Conversation
Abstractions that helps to use the native VSync of each target OS
Abstractions that helps to use the native VSync of each target OS
This was referenced Feb 26, 2026
This was referenced Mar 30, 2026
Merged
Merged
Closed
This was referenced Apr 18, 2026
This was referenced Aug 13, 2026
This was referenced Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves performance and efficiency on how the controls are drawn, this PR has no practical effect on Avalonia because all this PR does is already implemented/handled by Avalonia, LiveCharts just draws when and how Avalonia wants 😄.
1. GPU enabled by default
SkiaSharp 3 introduces hardware-accelerated views across all supported platforms. By default, LiveCharts now leverages GPU-backed views for rendering—offloading drawing tasks from the CPU to achieve smoother visuals and better performance.
Before initializing the chart, LiveCharts automatically probes the system’s GPU capabilities. If a suitable graphics context isn’t available (due to driver issues, platform limitations, or user configuration), LiveCharts seamlessly falls back to a CPU-rendered view to ensure reliability.
This adaptive strategy guarantees optimal performance when possible—and graceful degradation when necessary.
2. OS VSync
In previous versions, the chart relied on a fixed render loop that invalidated the control every ~16ms, simulating a ~60 FPS refresh rate. While this worked, it wasn’t optimal—it forced redraws regardless of whether the system was ready or willing to display them.
This PR introduces native VSync integration, allowing the OS or UI framework to dictate when a frame should be rendered. Why does this matter? Because the rendering now aligns with the system’s display pipeline:
🧠 Redraws only happen when the system can actually present them
🔋 Reduces unnecessary frame invalidations, saving power and CPU cycles
🎯 The FPS log now reflects real on-screen rendering, not just simulation ticks
Previously, the FPS counter measured how often frames were calculated, not necessarily drawn. With VSync in place, those numbers become truthful—frame pacing is accurate, rendering is smoother, and performance diagnostics are more meaningful.
The next table explains the ticker used on each OS, and compares them with the current method in the library (custom loop):
Results:
This benchmark compares rendering performance across major .NET UI frameworks on multiple platforms, LiveCharts now shares about 99% of the code between all UI frameworks, this test basically compares how efficient each UI framework is.
The next table show the Frames per second reached (FPS) and the render time it took for each frame in milliseconds:
{FPS} @ {render time in ms}FPS indicates frame rate stability, while render time reflects per-frame latency.
Additional test made:
Highlights
Avalonia consistently delivers high FPS on desktop platforms; Uno shines on WASM and has a consistent low frame latency, which means efficiency, while MAUI behaves performant across all the supported platforms.
Notes & Exceptions
Used Versions
Devices tested:
About the test
Release build using the Lines/Zooming example in this repo, move the chart from left to right 10 times, on desktop devices and WASM the chart size was of 900x500 pixels.