Skip to content
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

Performance Comparison #3

Closed
FabriceSalvaire opened this issue Apr 2, 2019 · 20 comments
Closed

Performance Comparison #3

FabriceSalvaire opened this issue Apr 2, 2019 · 20 comments

Comments

@FabriceSalvaire
Copy link

FabriceSalvaire commented Apr 2, 2019

As far I remember, NVidia peoples of the NVPath project did interesting comparisons with libraries like Cairo etc. especially cases where rendering was wrong.

Also it would be interesting to benchmark on GPU-less ARM platforms, Qt do benchmark driven optimisations on such platforms (with or no OpenGL GPU).

Edited by Blend2D Team:

Performance comparison of the following libraries would be welcome:

  • SKIA
  • Direct2D
  • FastUIDraw
@rubenvb
Copy link

rubenvb commented Apr 2, 2019

It would also be extremely interesting to see a comparison with Skia. The currently compared libraries are "old", although Qt has perhaps evolved the most of them architecturally.

@kobalicek
Copy link
Member

NVPR: I'm interested in this technology, but I think it would be fair to wait for multithreading before starting the comparison of software-based 2D against dedicated GPUs. As written on the website, Blend2D was written to make software-based 2D rendering faster so at the moment we compare with other software-based 2D renderers. I cannot comment ARM platforms atm as the work on ARM hasn't started yet.

SKIA: I tried building SKIA twice and was not successful with that. Since they use build system that I don't understand and that has minimum documentation I decided to not spend more time on this. Now when Blend2D is finally out anyone is welcome to contribute SKIA module to bl-bench tool. I'm wondering myself about the performance. So far the performance can only be extrapolated based on caskbench tool, which from 2014.

@rubenvb
Copy link

rubenvb commented Apr 2, 2019

Skia's build system is indeed somewhat esoteric and non-friendly to outsiders. I have a functional CMake setup to build Skia in my Skui project here (it's inside the third party submodule and currently at a somewhat older version of Skia: m67):
https://github.com/skui-org/skui

If you run cmake in a recursive clone of skui, and then build the "skia" target you should be good to go. I haven't done anything wrt installing it as a separate lib with headers though (on my todo list) so perhaps reusing the "3rdparty" repo is the easiest way to get a build of Skia working.

I can't promise anything on implementing a benchmark in blend2d, but I'm interested so if I find the time to help, something might pop up here.

@FabriceSalvaire
Copy link
Author

I retrieved the page https://www.slideshare.net/Mark_Kilgard/22pathrender p41 p42 should come from a Nvidia talk

@yzrmn
Copy link
Member

yzrmn commented Apr 3, 2019

https://www.slideshare.net/Mark_Kilgard/22pathrender

Currently, we are offsetting curves to stroke a path. It means that the rendering of Blend2D from page 41 will look similar to Skia and Qt. According to SVG this is expected behavior (https://www.w3.org/TR/SVG2/painting.html#StrokeShape). I think it would be technically possible to make it look like e.g. OpenVG Reference but it might be expensive to do so.

The rendering from page 42 should be no problem :)

@kobalicek
Copy link
Member

I'm wondering about the path from page 42, is there any data?

@yzrmn
Copy link
Member

yzrmn commented Apr 3, 2019

moveTo(300, 300);
cubicTo(310, 301, 310, 309, 300, 310);

image

Not exactly the same, but something like that...

@LifeIsStrange
Copy link

It would be nice to add Fastuidraw to the benchmarcks, it seems to be the only 2D renderer to have benchmarcks being many times faster than the current state of the art: Skia.

https://github.com/intel/fastuidraw

@melroy89
Copy link

melroy89 commented Nov 25, 2020

Well better add SDL and/or SFML to the list as well. Which are the most commonly used multimedia libraries out there (besides from the way too huge Skia).

EDIT: GTK4 is moving away from Cairo and directly using OpenGL/Vulkan calls. So keep an eye on them. Also Qt / Qt Quick is moving away from their QPainter and using hardware rendering as well (like using Scene Graph).

@LifeIsStrange
Copy link

LifeIsStrange commented Nov 25, 2020

@Danger89 interesting, I'm not an expert but does that means they'll switch from a retained renderer to an immediate mode? If so it is known to be suboptimal for 2D guis and scrolling.
Moreover skia has openGL and Vulkan backends so I don't see how this would be superior. No idea what is Scene Graph though, I should look into it

@kobalicek
Copy link
Member

I think it's the opposite - GTK is abandoning the immediate rendering model by introducing a scenegraph toolkit, which makes sense for UI where you only want to redraw what actually changed, or to redraw everything if there was changed too much. With scenegraph this becomes manageable.

However, I'm not sure how this could be used to benchmark Blend2D, which implements immediate rendering model at the moment - I'm not sure it would make sense to add scene-graph to Blend2D, more likely to have another library that implements it.

I think the best comparison would be with something GPU optimized which implements immediate mode, fastuidraw and SKIA would be good candidates.

@dumblob
Copy link

dumblob commented Apr 11, 2022

Time has passed and Skia comparison would be really interesting.

@kobalicek
Copy link
Member

kobalicek commented Apr 11, 2022

The benchmarking suite and samples will soon use Conan to fetch dependencies (both Cairo and Qt, and maybe even AGG). If anyone is willing to add a SKIA recipe to conan-center-index (issue here: conan-io/conan-center-index#2389) then I would implement the rest (SKIA benchmark module).

I would like to avoid maintaining build scripts to build SKIA and its dependencies, it's just too fragile and I prefer doing more interesting things instead.

@dumblob
Copy link

dumblob commented Apr 11, 2022

I would like to avoid maintaining build scripts to build SKIA and its dependencies, it's just too fragile and I prefer doing more interesting things instead.

I totally support this. I think it would be of enormous value even if the SKIA benchmark would be unmaintained (i.e. would become "old" soon) after benchmarking.

@projectitis
Copy link

projectitis commented Apr 29, 2022

A benchmark comparison with ThorVG would be very interesting, too. ThorVG is a dependency-free lightweight software renderer that utilizes threading. It's scene-based, but currently no partial redraw is supported as far as I know, so comparisons would be fair :)

I've just been working on updating the ThorVG renderer for Rive files (here), and I am wondering if I should try a Blend2D version next.

@kobalicek
Copy link
Member

I think Blend2D would beat ThorVG SW renderer significantly, because ThorVG is basically using FreeType code, which was not written for performance. I would assume ThorVG and Qt to give you similar performance (ThorVG maybe worse in some cases as it has very limited SIMD use, Qt at least has SIMD composition).

@projectitis
Copy link

I agree. ThorVG was created to run on low resource devices, like smart TVs, so performance was not the top priority. However I would be interested to see exactly what the difference is :)

@kobalicek
Copy link
Member

I have managed to build Skia via vcpkg and I have already a local branch that can test Skia with bl_bench. After this is merged I would close this issue as I'm not planning to test against Direct2D or FastUIDraw in near future (I don't really have time for that). If there is anyone willing to add Direct2D to bl_bench I would be happy though.

@kobalicek
Copy link
Member

kobalicek commented Aug 9, 2023

I think this issue can finally be closed, because:

  • Blend2D bencharking tool now has Skia support, the comparison is shown on the website
  • Direct2D is not considered at the moment as I don't really use Windows for development. Contributions are welcome, but this is not something I would want to do.
  • FastUIDraw project died and is not supported anymore, thus I'm not considering using it or comparing against it.

@kobalicek
Copy link
Member

I'm closing this issue, please open a new one if you miss a library to be benchmarked against, and if possible, provide an implementation as well, as for me the currently benchmarked libraries are enough to get an overview of Blend2D performance and optimization opportunities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants