mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 01:57:19 +00:00
254e1ca7f7
I noticed that the rendering of a TOC with around 200 entries seemed frustratingly slow. First, I analysed the execution of the code using the Chrome developer tools "timeline" tab: prepare by switching to the "Tools" tab, then start profiling, switch to the "Contents" tab, and then stop profiling once it has displayed. I then used the "bottom-up" view to dectermine that the various Object.keys() calls in the main wiki store were taking around 500ms of the overall time. Before making any code changes, I also used TW's built in instrumentation to get some baseline timings: I found that the main refresh cycle was taking around 3.0s when rendering the Contents tab. I then performed the attached simple optimisations of caching the list of tiddler titles and the list of shadow tiddler titles. The results bring the overall main refresh time down to about 1.9s, a nearly 50% improvement. The moral of the story is that the first rule of optimisation is measurement... |
||
---|---|---|
.. | ||
boot.css.tid | ||
boot.js | ||
bootprefix.js | ||
sjcl.js | ||
sjcl.js.meta |