Here's Pathfinder rendering a port of the NanoVG demo, showing off its new support for HTML canvas features: https://github.com/servo/pathfinder/blob/master/examples/canvas_nanovg/src/main.rs … (Most of the rendering time goes to Gaussian blurs which have to be spec compliant in Pathfinder, unfortunately…)pic.twitter.com/P8SAZTw55A
-
Show this thread
-
Replying to @pcwalton
Wait but the CPU time there is also slow and presumably that’s not because of the blurs, and there doesn’t look to be that many primitives here. What’s taking the CPU time?
2 replies 0 retweets 0 likes -
Replying to @trishume
I added a quick outline cache, which improved CPU time by 35% or so, and now HarfBuzz jumps to the top of the profile. Sigh. There’s a limit as to how much caching I necessarily want to add right now, as the NanoVG demo is supposed to be a usage demo, not really a perf test…
1 reply 0 retweets 1 like -
In a serious app you’d lay out the text up front so you don’t have to reflow every frame (which PF supports with a canvas extension), but I’m hesitant to do that because it adds noise to the code. A per-word shape cache is another sol’n, but
@raphlinus and I were a bit hesitant.1 reply 0 retweets 0 likes
Text layout is definitely expensive. Caching buys you so much, at some point you want to retain the text layout object so you're not redoing it, but this pushes complexity into the app.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.