Windows raster surface rendering up to 4 times slower than on linux or macos

146 views
Skip to first unread message

Egor Orachev

unread,
Aug 10, 2021, 8:29:05 AM8/10/21
to skia-discuss
We are using skija (custom skia-build bindings for java without extra logic or overhead) for simple window rendering.

On Windows 10 Pro with Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz  2.30 GHz
in single threaded mode simple scene rendering (call to skia for paint) takes up to 60 ms,
actual blit for present takes up to 1ms. 

Window/Canvas resolution does not have an effect. FullHD or 4K resolution with the same pixel depth (32N) takes the same 60ms.

Where in the same time on the PC with Linux installed the same scene takes nearly 10ms.

So the question is: does skia have any know issues about slower Windows rendering,
or may be we've missed some sse/avx flags for speed-up?

Brian Osman

unread,
Aug 10, 2021, 9:06:29 AM8/10/21
to skia-d...@googlegroups.com
Are you compiling with MSVC on Windows? If so, this is probably expected. Skia only has SIMD support when built with Clang, so the Raster backend performance will suffer with other compilers.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/5a897edf-72c3-4d6a-b7bf-6c5a72b2a180n%40googlegroups.com.

Egor Orachev

unread,
Aug 10, 2021, 10:14:23 AM8/10/21
to skia-discuss
High, thank you for your responce.

Yeah, we are compiling our skia build with MSVC toolchain.
So, if I understand correctly, it must be possible to build skia on witdows with Clang + SIMD support => it potentially may fix the problem?


Brian Osman

unread,
Aug 10, 2021, 10:20:55 AM8/10/21
to skia-d...@googlegroups.com
Yes, you can build with clang (this is actually what chrome/chromium does). In fact, clang includes something called `clang-cl` (https://clang.llvm.org/docs/UsersManual.html#clang-cl) that tries to maximize compatibility with MSVC, which may be helpful. (Again, this is what chromium uses). It accepts many MSVC-style command line switches, and is lenient about many differences between MSVC and clang.

Visual studio itself also includes support for clang as part of the IDE (https://docs.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-160). Regardless of how you get clang and use it to build, Skia will detect it and automatically enable SIMD optimizations in the Raster backend.

Reply all
Reply to author
Forward
0 new messages