Does the Edittemplate tag eat a lot of resource of computer?

39 views
Skip to first unread message

Zhe Lee

unread,
Sep 12, 2020, 10:04:59 AM9/12/20
to TiddlyWiki
Here is the thing, I use a template to add a button to every tiddler. The thing is I don't use the button that much but still use it sometimes. 

I want to know is the EditTemplate tag like this will eat a lot of resource of computer and finally slow down the responding of the TiddlyWiki? Should I delete the template tiddler if I don't use the template that much?  


PMario

unread,
Sep 12, 2020, 10:16:29 AM9/12/20
to TiddlyWiki
Hi,
There shouldn't be a problem.
-m

Eric Shulman

unread,
Sep 12, 2020, 10:47:52 AM9/12/20
to TiddlyWiki
On Saturday, September 12, 2020 at 7:04:59 AM UTC-7, Zhe Lee wrote:
Here is the thing, I use a template to add a button to every tiddler. The thing is I don't use the button that much but still use it sometimes. 
I want to know is the EditTemplate tag like this will eat a lot of resource of computer and finally slow down the responding of the TiddlyWiki? Should I delete the template tiddler if I don't use the template that much?  

It doesn't take a lot of overhead to render the $button, even if it added to every tiddler.  This is especially true since it is added to the EditTemplate, as there is usually only one tiddler (or perhaps a few tiddlers) being edited at any given moment.

Even so, there is a way you can reduce the overhead even further by using the $button actions="..." parameter, like this:

\define doCreate()
<$action-sendmessage $message="tm-new-tiddler" title="This is newly created tiddler" tags={{!!tags}} text=<<now "Today is DDth, MMM YYYY">> />
\end
<$button actions=<<doCreate>>>Copy Current Tags and Create</
$button>
When you use this syntax, the doCreate() macro is only processed when the $button is actually pressed.

Note that this also causes the <<now>> macro used to generate the new tiddler's text to only be invoked when the $button is pressed.  This produces a subtle but somewhat important difference in the resulting tiddler's content.
For example, if you were to start editing a tiddler just before midnight, but not press the button until after midnight, the date written into the tiddler text will accurately record when the $button is pressed, not when it was initially rendered.

enjoy,
-e
Reply all
Reply to author
Forward
0 new messages