QuantumBadger / Speedy2D

Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.
Apache License 2.0
386 stars 42 forks source link

Window `run_loop` bottlenecked on `GlyphCache::get_renderer2d_actions` #93

Open superlou opened 1 year ago

superlou commented 1 year ago

In my application, I'm drawing a lot of text. I cache the FormattedTextBlock (https://github.com/superlou/signrs/blob/b453aae0f8cfc38e800f59db5f5be09248ebe836/src/js_env/graphics.rs#L116-L140) so that they aren't recreated every frame. However, when profiling the application, I'm spending the bulk of the speedy2d time in GlyphCache::get_renderer2d_actions.

flamegraph Flamegraph SVG file

Is there possibly somewhere I can start looking in there to improve the performance of GlpyhCache, or is that already heavily optimized?