A 'theoretical' question about \import

53 views
Skip to first unread message

Hubert

unread,
Jan 28, 2019, 9:08:08 AM1/28/19
to TiddlyWiki
Hello,

I'm consolidating my frequently used macros and variables in a single tiddler titled GlobalVariables so that I can easily import those variables/macro definitions in other tiddlers as needed, using the \import pragma.

My assumption is that when I open the importing tiddler, one of the following two things will happen:

(1) the entire \import payload is loaded into RAM for as long as the importing tiddler is open, therefore having a potentially negative impact on TW/browser performance (though I suspect this decrease in performance could be negligible)

(2) the \import payload merely becomes available to the importing tiddler but will only occupy RAM if and when the content being imported is re-used in any way in the importing tiddler (e.g. as a parameter of a macro defined in the importing tiddler etc.)

Apologies if this is a stupid question but thanks for your thoughts nevertheless.
NB. I don't have the necessary tools to test this myself.

Best regards,
Hubert

TonyM

unread,
Jan 28, 2019, 9:27:39 AM1/28/19
to TiddlyWiki
hubert,

You seem to be basicaly correct. After drop, if you do not import, the next drop will add to or replace the prior tempoary json tiddler containing all the payload tiddlers.

Import and cancel delete this tempoary payload tiddler. Which may supprise you is $:/Import

I belive the tempoary payload is not saved back to disk when you hit save.

You can change the way the way the $:/Import tiddler is built on drop and can add your own import tools.

Regards
Tony

Hubert

unread,
Jan 28, 2019, 9:38:32 AM1/28/19
to TiddlyWiki
Thanks for your input Tony. I should have made myself clearer and I apologies if I didn't, English is not my first language.

My question was regarding the \import pragma, similar to the older ImportVariables widget, and not regarding the process of importing tiddlers to wiki by drag and drop or copy and paste.

Specifically, I'm trying to find out what the impliactions would be to TW performance/RAM (if any) in cases where I would import many variables/macro definitions in this way as 'collateral damage' (=unneeded).

Again, apologies if my question is not clear.

Regards,
Hubert

TonyM

unread,
Jan 28, 2019, 10:00:14 AM1/28/19
to TiddlyWiki
No worries

I do not expect it to have much impact because when you import variables they are imported for that tiddler, but when you creat global macros every tiddler "imports" the global macros at render time. I use hundreds of global macros with no problems.

The only caviet is you could make a macro that had an encyclopedia in it, then you may have a problem.

Regards
Tony

Reply all
Reply to author
Forward
0 new messages