cljs-react-perf
cljs-react-perf copied to clipboard
Rum & Sablono optimizations
Here's a repo with some macros to optimize Rum & Sablono https://github.com/funcool/rumext Basically there are a couple of additional compile forms for Sablono and lazy-component function which delays Rum component instantiation which improves start up time.
Thanks for the pointer. Is this a project you worked on?
I can't tell from the repo the author's motivations:
- was it performance?
- was it to extend semantics?
- why is this a separate repo rather than a patch against rum/sablono?
the author is @niwinz
I don't know why it is not in Sablono and Rum, but additional compiler forms for Sablono obviously avoids more interpret
calls, which results in a better perf and output bundle size. The same goes to lazy components, it improves startup time.
here's a note on lazy components in Rum's wiki https://github.com/tonsky/rum/wiki/Optimizations
This startup time thing would be an awesome addition to this repo. It was before React, but when I worked on The Weathertron cljs/html mobile app we did a ton to try and improve startup time.
Since this delay test doesn't fit into the re-render test runner, I'll have to do something custom. What do you think about:
- one namespace w/ a bunch of regular components
- one namespace w/ the same components, but "delayed"
- test runner opens a new browser referring to JS from one of these namespaces
- test runner measures time it takes to simply parse/run the namespace, as measured by a "done" message emitted at the bottom of each namespace.
Running this 10x times for each namespace and reporting on the timings should measure any benefits of "delay".
Do you think that'd be a reasonable way to test this? Any suggestions/alternatives?