linebender / piet

An abstraction for 2D graphics.
Apache License 2.0
1.26k stars 94 forks source link

(D2D) clip<RoundedRect> is expensive #309

Open smmalis37 opened 4 years ago

smmalis37 commented 4 years ago

Admittedly my test case (https://github.com/smmalis37/sudoku_rust) with over 700 labels visible at once may be a bit extreme, but this shows up in profiling as one of the most expensive functions throughout the whole app. This is due to a combination of things:

smmalis37 commented 4 years ago

MSDN has this to say: "In general, you should create geometries once and retain them for the life of the application, or until they need to be modified."

https://docs.microsoft.com/en-us/windows/win32/api/d2d1/nn-d2d1-id2d1geometry