Hacker News new | ask | show | jobs
by revvx 2605 days ago
> The CPU was spending 15-20% of its time every frame recreating the UI's vertex buffer.

Not saying it is easy, but it's possible to optimize and cache vertex buffers by using something similar to React's VDOM.

1 comments

Doesn't your cache just become a limited retained mode with a somewhat hacky, opaque API?
Basically yes. If an immediate mode API is much easier to use, and a retained mode underlying implementation has much better performance, then putting a React-style VDOM layer in-between could get the best of both worlds, depending on how well the middle layer is implemented.