-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Render Canvas Benchmarks #1820
Conversation
inforithmics
commented
Feb 4, 2023
Method | Mean | Error | StdDev | Min | Max | Median | Allocated |
---|---|---|---|---|---|---|---|
RenderDirect | 3,921.8 ns | 12.92 ns | 11.46 ns | 3,905.0 ns | 3,943.1 ns | 3,922.4 ns | - |
RenderDirectLessPoints | 617.4 ns | 1.36 ns | 1.27 ns | 614.6 ns | 619.6 ns | 618.0 ns | - |
RenderRotationCanvasEveryTime | 1,711.8 ns | 5.09 ns | 4.76 ns | 1,705.4 ns | 1,722.6 ns | 1,711.2 ns | - |
RenderScaleCanvasEveryTime | 6,832.4 ns | 18.03 ns | 15.05 ns | 6,812.3 ns | 6,866.2 ns | 6,832.2 ns | - |
RenderTranslationCanvasEveryTime | 3,014.1 ns | 9.29 ns | 8.69 ns | 3,002.0 ns | 3,031.2 ns | 3,015.2 ns | - |
RenderTranslationScaleCanvasEveryTime | 6,829.9 ns | 10.97 ns | 9.72 ns | 6,816.9 ns | 6,849.0 ns | 6,828.0 ns | - |
RenderRotationCanvasOnce | 1,651.5 ns | 3.74 ns | 3.50 ns | 1,644.9 ns | 1,657.8 ns | 1,651.2 ns | - |
RenderRotationPath | 1,488.8 ns | 29.53 ns | 34.01 ns | 1,455.7 ns | 1,585.4 ns | 1,476.3 ns | - |
RenderOffCanvas | 41,133.9 ns | 426.43 ns | 398.88 ns | 40,604.7 ns | 41,739.2 ns | 41,053.2 ns | - |
| Method | Mean | Error | StdDev | Min | Max | Median | Allocated | |-------------------------------------- |------------:|----------:|----------:|------------:|------------:|------------:|----------:| | RenderDirect | 3,921.8 ns | 12.92 ns | 11.46 ns | 3,905.0 ns | 3,943.1 ns | 3,922.4 ns | - | | RenderDirectLessPoints | 617.4 ns | 1.36 ns | 1.27 ns | 614.6 ns | 619.6 ns | 618.0 ns | - | | RenderRotationCanvasEveryTime | 1,711.8 ns | 5.09 ns | 4.76 ns | 1,705.4 ns | 1,722.6 ns | 1,711.2 ns | - | | RenderScaleCanvasEveryTime | 6,832.4 ns | 18.03 ns | 15.05 ns | 6,812.3 ns | 6,866.2 ns | 6,832.2 ns | - | | RenderTranslationCanvasEveryTime | 3,014.1 ns | 9.29 ns | 8.69 ns | 3,002.0 ns | 3,031.2 ns | 3,015.2 ns | - | | RenderTranslationScaleCanvasEveryTime | 6,829.9 ns | 10.97 ns | 9.72 ns | 6,816.9 ns | 6,849.0 ns | 6,828.0 ns | - | | RenderRotationCanvasOnce | 1,651.5 ns | 3.74 ns | 3.50 ns | 1,644.9 ns | 1,657.8 ns | 1,651.2 ns | - | | RenderRotationPath | 1,488.8 ns | 29.53 ns | 34.01 ns | 1,455.7 ns | 1,585.4 ns | 1,476.3 ns | - | | RenderOffCanvas | 41,133.9 ns | 426.43 ns | 398.88 ns | 40,604.7 ns | 41,739.2 ns | 41,053.2 ns | - |
I tested out what influences Render Performance and I discovered following things.
So Conclusion. Transforming is relatively cheap. So I could use Something like a GemetricSimplifier to reduce the Path before translating it to a Path, And caching the SkPath on the Geometry. Or use the The ZoomLevel for caching. The higher the Zoomlevel the more complex the path. Here the GeometrySimplifyProvider. |
Thanks for you systematic analysis! Some remarks:
|
I think actual Performance Improvements should be done on a seperate pullrequest. So this adds mainly the RenderBenchmark and some extenion Methods for Performance improvements. So I think the SkPath should be created resolution independent. And then transformed to the correct resolution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks.