From 184fd9dda869e1e4b784b54f1f8bc6c471c46b3b Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 11 May 2019 19:28:09 +0100 Subject: [PATCH] Docs for Performance Instrumentation improvements Left off e8d1fbba6 --- .../features/Performance Instrumentation.tid | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/editions/tw5.com/tiddlers/features/Performance Instrumentation.tid b/editions/tw5.com/tiddlers/features/Performance Instrumentation.tid index b7a95a39c..270e8bf7d 100644 --- a/editions/tw5.com/tiddlers/features/Performance Instrumentation.tid +++ b/editions/tw5.com/tiddlers/features/Performance Instrumentation.tid @@ -1,5 +1,5 @@ created: 20190316163428191 -modified: 20190316163657710 +modified: 20190510133455372 tags: Features title: Performance Instrumentation type: text/vnd.tiddlywiki @@ -10,22 +10,27 @@ With performance instrumentation switched on, there is additional timing informa ``` performance: mainRender: 327.83ms -performance: +filter: 49.70ms performance: styleRefresh: 9.14ms -performance: +filter: 2.46ms performance: mainRefresh: 68.10ms -performance: +filter: 37.69ms ``` The information above should be interpreted as follows: -<<< -"Initial rendering of the main page took 327ms (of which 50ms was filter evaluation). Refreshing the page stylesheet took 9ms (of which 2ms was filter evaluation). Refreshing the main page took 68ms (of which 38ms was filter evaluation)" -<<< - * mainRender is the time taken for the initial display of the page template * styleRefresh is the time taken to refresh the page stylesheet * mainRender is the time taken to refresh the main page template -* in each case, +filter denotes the time taken up with filter evaluation. -As an example, try switching between the sidebar tabs to compare how long they take to render. \ No newline at end of file +As an example, try switching between the sidebar tabs to compare how long they take to render. + +More detailed information on filter execution timings is also available. With performance instrumentation enabled, ype the following JavaScript command in the browser developer console: + +``` +tw.perf.log() +``` + +A table is displayed with the following information: + +* ''name'' - the string "Filter: " plus the text of the filter +* ''invocations'' - the number of invocations of the filter since startup +* ''totalTime'' - the total time in milliseconds spent evaluating this filter since startup +* ''percentTime'' - the percentage of the execution time of this filter against the total execution time of all filters