TranscludeWidget is very slow to load when used from a template

110 views
Skip to first unread message

talha131

unread,
Aug 31, 2020, 2:45:30 PM8/31/20
to TiddlyWiki

I have a macro <<tagVerticalTabsUnsorted>>, which let’s me view all the tiddlers with a specific tag in one list.

Screen Shot 2020-08-31 at 23.31.06.png

Problem

It used to work without a glitch. Now that I have more than 1000 tiddlers and with several images, it takes too long to load the tiddler.

It shows the tiddler title, but not the content, like this.

Screen Shot 2020-08-31 at 23.36.57.png

If I leave the TW for a few minutes, it then loads then content automatically.

OR, if I open another tiddler or close a tiddler, this kicks the transclusion of the content work.

If I use a tag with only 5 tiddlers, this macro works fine. But when I have tens of tiddlers, it starts to slow down.

Help Me

Kindly let me know how can I improve the performance of transclusion.

OR suggest an alternative way to show list of tiddlers with a specific tag, if tabs and transclusion cannot work with hundreds of tiddlers.

Macro

\define tagVerticalTabsUnsorted(defaultTid:"")

@@float:right;
<span>
{{||$:/core/ui/TagTemplate}}
</span>
@@

<$macrocall $name="tabs" 
tabsList="[tag<currentTiddler>]"
default=<<__defaultTid__>>
state="$:/state/tab1" 
class="tc-vertical" 
template="$:/talha131/Template/VerticalTab"
retain="yes"
/>

\end

Template

<$tiddler tiddler=<<currentTab>>>

<$link to={{!!title}}>

! {{!!title}}

</$link>

<$transclude mode="block" />

</$tiddler>

PMario

unread,
Aug 31, 2020, 2:55:10 PM8/31/20
to TiddlyWiki


On Monday, August 31, 2020 at 8:45:30 PM UTC+2, talha131 wrote:
...
<$macrocall $name="tabs" 
tabsList="[tag<currentTiddler>]"
default=<<__defaultTid__>>
state="$:/state/tab1" 
class="tc-vertical" 
template="$:/talha131/
Template/VerticalTab"
retain="yes"               <---- THIS is the problem. 
/>

\end


retain will keep every tiddler, that is listed in the tab in memory. So if there is a refresh it will update every tiddler in memory, even if you don't see them.

Set this to "no" and it should be much faster.

-mario

Eric Shulman

unread,
Aug 31, 2020, 2:56:23 PM8/31/20
to TiddlyWiki
On Monday, August 31, 2020 at 11:45:30 AM UTC-7, talha131 wrote:

Macro

\define tagVerticalTabsUnsorted(defaultTid:"")

@@float:right;
<span>
{{||$:/core/ui/TagTemplate}}
</span>
@@

<$macrocall $name="tabs" 
tabsList="[tag<currentTiddler>]"
default=<<__defaultTid__>>
state="$:/state/tab1" 
class="tc-vertical" 
template="$:/talha131/Template/VerticalTab"
retain="yes"
/>

\end
Try removing the retain="yes" parameter from the $macrocall for "tabs".  This parameter is passed through to an underlying $reveal widget within the macro. However, as noted here: https://tiddlywiki.com/#RevealWidget:

Retaining the content when hidden can give poor performance since the hidden content requires refresh processing even though it is not displayed. 

-e

talha131

unread,
Aug 31, 2020, 3:06:35 PM8/31/20
to TiddlyWiki

Thank you. I have tried retain="no", but the result is still the same. It still takes more than 30 seconds to load the tiddler.

talha131

unread,
Aug 31, 2020, 3:16:35 PM8/31/20
to TiddlyWiki

I tried a different widget, toc but the delay is still present, though the delay is much shorter than before. But it is not instantaneous.

<<toc-tabbed-internal-nav
tag:"fish-shell"
selectedTiddler:"$:/temp/tb5-tabbed-toc-example"
unselectedText:"Select a topic in the table of contents to the left.<br>Click the arrows to expand topics."
>>

talha131

unread,
Aug 31, 2020, 3:20:48 PM8/31/20
to TiddlyWiki

More information

I am running TW from nodeJS, which shows this slow behaviour. But the HTML file built from the tiddlers does not have any performance issue.

So my guess is, TW running on NodeJS has performance issue.

TW Tones

unread,
Aug 31, 2020, 9:00:19 PM8/31/20
to TiddlyWiki
Talha,

A few thoughts (I subscribe to ego-less programming so please don't read between the lines of what I say) 
  • When we ask software to do more it takes more. I we may consider node has the advantage of load on demand, where a single file wiki loads everything into memory first, it is not surprising we see such a situation.
  • I have often seen in tiddlywiki so called "performance problems" occur but they are the result of more work not an inherent issue.
  • Tiddlywiki out of the box is doing a lot to maintain connections, currency and interactivity. 
    • So when output is closer to a batch operation it will start to behave as a batch process and have running times.
    • Will the user really need to see a 1000 items at once?
  • I have seen this with SQL, users can ask silly questions (not saying yours is) without knowledge of the underlying database that unnecessarily touches every record and takes hundreds of times longer.
  • Search is one way around this, as is set then generate results
    • The default search not starting until 3 characters are provided is an example of avoiding too big a list.
  • There is a new plugin that may help in some cases https://tiddlywiki.com/prerelease/#Dynaview%20Plugin
I have created a snapshot button to save the result of a complex or large tiddler so the computation can be triggered not on opening but on demand, would this help your current solution?

In closing 
  • there are a lot of things that can be done in tiddlywiki to improve performance, and it may be as simple as closing the sideBar so it does not refresh of every change.
  • If you had an example I could test on Tiddlywiki.com I (and others) could help improve performance.

Regards
Tony
Message has been deleted

Mark S.

unread,
Aug 31, 2020, 10:44:09 PM8/31/20
to TiddlyWiki
What is the command line you are using to launch? Is it possible that you have lazy loading enabled?

I thought lazy-loading was automatically disabled on node, but I see there is this hidden setting:


It might be worth experimenting to see if changing it makes a difference (probably have to change, save, and restart).

PMario

unread,
Sep 1, 2020, 3:15:52 AM9/1/20
to TiddlyWiki
Hi,

Which plugins do you use?
How big is your wiki?

-mario

talha131

unread,
Sep 1, 2020, 2:57:07 PM9/1/20
to TiddlyWiki

Thank you all of you. You people have fixed a major headache for me. Using


tiddlywiki --listen root-tiddler=$:/core/save/lazy-all

was the issue.

I replaced it with

tiddlywiki --listen root-tiddler=$:/core/save/lazy-images

and this fixed the issue.

I never guessed that lazy-all could be the reason, because my TW used to work perfectly.

Reply all
Reply to author
Forward
0 new messages