-
Notifications
You must be signed in to change notification settings - Fork 149
Description
I'm using BatchedText to display large number (3000+) of Text objects in a single draw call. While my GPU rendering time is low, I noticed that about 30%-50% of my frame time is spent in the Text.onBeforeRender() method. I tried extending your classes to optimize the performance but without any luck. Do you have any ideas for potential optimizations? I'd be happy to create a PR if I'm successful, I just need a few pointers. Two potential ideas for improvement I noticed are checking for dirty flag on members in BatchedText._prepareForRender() loop, and caching computed uniforms in Text._prepareForRender(). My texts are mostly static, but I frequently change transformation matrices and clipRect, and also occasionally text alignment. I'm attaching the Chrome DevTools trace (taken with 4x CPU slowdown) so you can see the problem.