Performance questions

164 views
Skip to first unread message

Erwan

unread,
Sep 16, 2015, 7:56:01 PM9/16/15
to tiddl...@googlegroups.com

Hi all,

I see here several helpful tips about performance. I want to do some tests, but ideally I would like to be able to measure the impact of the different options with a certain level of precision. For example, would it be possible to display the time that TW takes to render a particular tiddler? Has anybody already done something similar?

Another question on the same topic: I was wondering if a filter based on fields could be faster than a filter based on tags? e.g. [tag[JeremyRuston]] vs. [field:author[JeremyRuston]]
My intuition being that the former case might be slower because all the tags have to be parsed, but that depends how tasg and fields are represented internally of course.

ps: just in case, please bear in mind that my knowledge about JavaScript is close to zero!


Thank you!
Erwan

Erwan

unread,
Sep 22, 2015, 3:02:04 PM9/22/15
to TiddlyWiki

I see here several helpful tips about performance. I want to do some tests, but ideally I would like to be able to measure the impact of the different options with a certain level of precision. For example, would it be possible to display the time that TW takes to render a particular tiddler? Has anybody already done something similar?


Answering my own question, but better ideas are still welcome!

I found a simple but not very accurate way to do that: I display the current time (actually I need only the seconds) using the <<now>> macro before and after transcluding the tiddler that I want to measure. since the format doesn't allow milliseconds I repeat the content N times in order to see a visible difference in seconds. For convenience I define a template tiddler TimeTest as follows:

<<now 0ss>>

<$transclude />
<$transclude />
<$transclude />
<$transclude />
<$transclude />
<$transclude />
<$transclude />
<$transclude />
<$transclude />
<$transclude />

<<now 0ss>>

Then I can measure the time taken to render MyTiddler with:

 {{MyTiddler||TimeTest}}


Erwan

Danielo Rodríguez

unread,
Sep 22, 2015, 4:15:03 PM9/22/15
to TiddlyWiki
Hello Erwan,

I don't know your javascript background, but measuring the time before and after a set of executions is the normal way to benchmark different algorithms. Take a look at jsperf to see if it inspires you. But in my opinion milliseconds are important.

Jeremy Ruston

unread,
Sep 22, 2015, 4:44:28 PM9/22/15
to tiddl...@googlegroups.com, TiddlyWiki
Hi Erwan

I'm on my phone but you should be able to locate the performance monitoring that's present in the startup module render.js (from memory!). Currently one has to modify the source to turn it on; a pull request to make it configurable via a tiddler would be useful!

Best wishes

Jeremy


On Tue, Sep 22, 2015 at 10:15 PM, Danielo Rodríguez <rdan...@gmail.com> wrote:

Hello Erwan,

I don't know your javascript background, but measuring the time before and after a set of executions is the normal way to benchmark different algorithms. Take a look at jsperf to see if it inspires you. But in my opinion milliseconds are important.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e473bcb1-cddf-47fc-9db7-2d022b1a89e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Erwan

unread,
Sep 27, 2015, 3:17:36 PM9/27/15
to tiddl...@googlegroups.com

Thank you Danielo and Jeremy for your answers.

Unfortunately I'm basically clueless about Javascript so I can't do anything about making it configurable, but if anyone is interested here are some instructions to enable performance logging, as Jeremy suggested. This is based on Jeremy's explanation found at https://github.com/Jermolene/TiddlyWiki5/issues/590:

1) edit $:/core/modules/startup.js and set true instead of false in the line var PERFORMANCE_INSTRUMENTATION = false;
2) reload the wiki
3) open the web console (in firefox: Tools->Web Developer->web console): every time you open a tiddler it shows how much time it took in ms.

btw there's already an open issue about making this configurable: https://github.com/Jermolene/TiddlyWiki5/issues/1241.

Thank you!
Erwan
Reply all
Reply to author
Forward
0 new messages