1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 01:57:19 +00:00
TiddlyWiki5/boot
Jermolene 254e1ca7f7 Optimise some tiddler store operations
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...
2017-12-21 15:46:01 +00:00
..
boot.css.tid Rename "tw-error-*" classes to "tc-error-*" 2014-08-28 17:39:32 +01:00
boot.js Optimise some tiddler store operations 2017-12-21 15:46:01 +00:00
bootprefix.js Minor tweaks to boot kernel for AWS 2015-12-19 18:52:25 +00:00
sjcl.js Update Stanford JavaScript Library to 1.0.7 2017-07-18 15:42:35 +01:00
sjcl.js.meta Make the core into a plugin 2013-03-28 17:07:30 +00:00