-
Notifications
You must be signed in to change notification settings - Fork 546
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
SKCanvas rendering rotated image very slow compared to System.Drawing (4x slower) #758
Comments
Having the same issue. did u find any solution? |
Interesting. How does the draw speed compare when the rotation is 0, and when at 90? Also, What happens if you drop the filter quality? I'll have to setup some benchmarks - but it may be related to #686. In the skia forums, there are orders of magnitude improvements for clang. I am busy having a look at clang for Linux #767 and going to do some tests. |
@mattleibow If I drop filter quality, then performances get "normal" again (about as fast as System.Drawing with same quality) I don't understand the #686 Clang compiler discussion, since I thought Skia was HW accelerated. Talking about a compiler optimisation let us think that image rotation is done by SW. Is it the case? |
@mattleibow For Mapsui this is a blocking issue. Moving the map around is very choppy even with a single image. Our next release will be with 1.60.3. |
@mattleibow Are you aware of any changes that could have improved this issue in the new prerelease? |
So I got some benchmarks up and running, and I see there is an issue somewhere. It just appears to have a MASSIVE spike for all combos for a non 90 degree rotation. Even with all the options turned up, if it is 0, 90 or 180 degrees, it is fast. With everything turned off, a small rotation of 20 degrees basically grinds it to a standstill. BenchmarkDotNet=v0.12.0, OS=Windows 10.0.17763.805 (1809/October2018Update/Redstone5)
Intel Xeon CPU E5-2673 v4 2.30GHz, 1 CPU, 2 logical and 2 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 3.0.0 (CoreCLR 4.700.19.46205, CoreFX 4.700.19.46214), X64 RyuJIT
Job-BOOPOE : .NET Framework 4.8 (4.8.3761.0), X64 RyuJIT
Runtime=.NET 4.7.2 InvocationCount=1 UnrollFactor=1
|
Now, those numbers are scary actually... 50000 vs 80. There is also this discussion: https://groups.google.com/forum/#!topic/skia-discuss/ZZ7Ol3alB-I I see that my mac also shows slowdown, but also just 10x. I think this may be a bad thing because Windows is using MSVC. I am going to have to switch to clang. UWP is going to be a bit of a pain as it is not officially supported, but with a 150x slowdown with MSVC, we are going to have to do it. |
With this PR (#1007) we will switch to Clang to fix the issues with MSVC - or rather use the Compiler skia is optimized for. BenchmarkDotNet=v0.12.0, OS=Windows 10.0.17763.805 (1809/October2018Update/Redstone5)
Intel Xeon CPU E5-2673 v4 2.30GHz, 1 CPU, 2 logical and 2 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 3.0.0 (CoreCLR 4.700.19.46205, CoreFX 4.700.19.46214), X64 RyuJIT
Job-BNLYMT : .NET Framework 4.8 (4.8.3761.0), X64 RyuJIT
Runtime=.NET 4.7.2 InvocationCount=1 UnrollFactor=1
|
Rendering a rotated bitmap with SKCanvas is slow, compared with System.Drawing (4x slower)
See below code, it produces following output:
rotation: 20°
Skia: 6860ms
System.Drawing: 1643ms
Note that, without rotating, Skia is much faster than System.Drawing (36x faster).
Symptom : Skia 4x slower than System.Drawing, with provided code.
Expected : Skia faster than System.Drawing, with provided code.
The text was updated successfully, but these errors were encountered: