Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issues for larger trees #8

Closed
MeneDev opened this issue Oct 23, 2020 · 9 comments
Closed

Performance issues for larger trees #8

MeneDev opened this issue Oct 23, 2020 · 9 comments

Comments

@MeneDev
Copy link

MeneDev commented Oct 23, 2020

Thanks for the great work! I noticed that editing in a larger tree is pretty slow making typing sluggish. It would be great if the editing behaviour could be changed so that the edits are only applied after a few seconds of inactivity or when the editor is closed?

@saqimtiaz
Copy link
Owner

@MeneDev I'm aware of the issue but only in really really large trees like: https://saqimtiaz.github.io/sq-tw/streams-tiddlytoolmap.html

As mentioned on the Roadmap, the plan is to eventually use something similar to the draft mechanism the core uses to avoid this issue. However that wont be for a while until I have the time to dedicate to what will be a pretty extensive refactoring.

For now your best option would to open a part of the subtree and close the main tree when editing. Or if you are willing to tweak and experiment a bit, you could try setting the nodes to have the field: throttle.refresh
See https://tiddlywiki.com/#RefreshThrottling

Another option is to collapse parts of the tree that are not in use. A "collapse all" feature would be useful here and is planned, but there is no specific timeline for when I might be able to work on that.

@MeneDev
Copy link
Author

MeneDev commented Oct 26, 2020

Thanks, wasn't aware of those tw features. I dug a bit deeper and the main performance issue seems to be the styleRefresh which is currently applied with each keystroke, even if I set throttle.refresh. For testing I set $:/config/Drafts/TypingTimeout to 2000, yet the style changes are applied immediately. It's happening in $:/core/modules/startup/render.js:51. I'll try to investigate further.

@saqimtiaz
Copy link
Owner

@MeneDev could you please confirm if styleRefresh() is also called with every keystroke in an empty TiddlyWiki with no plugins, when typing in a tiddler?

@MeneDev
Copy link
Author

MeneDev commented Dec 4, 2020

No, I did some changes and that improved performance massively: I have Stroll installed, the backreferences were reevaluated when typing, I removed that part of Stroll, I also disabled all other plugins.
One surprising finding: using the Vanilla theme with enabled Sticky titles causes [[200]subtract<currentTiddler>] (in wiki/tiddlers/$__themes_tiddlywiki_vanilla.json) to be reevaluated. Adding a single character increases the counter by exactly 300 invocations.

@saqimtiaz
Copy link
Owner

No, I did some changes and that improved performance massively:

That is good to hear. I had been rather surprised that you were having such significant performance issues. I have some further performance optimizations planned for after the release of TiddlyWiki 5.1.23

One surprising finding: using the Vanilla theme with enabled Sticky titles causes [[200]subtract<currentTiddler>] (in wiki/tiddlers/$__themes_tiddlywiki_vanilla.json) to be reevaluated. Adding a single character increases the counter by exactly 300 invocations.

Oh wow. If that happens without any plugins, I highly recommend reporting an issue at https://github.com/Jermolene/TiddlyWiki5

@saqimtiaz
Copy link
Owner

PS: I am going to leave this issue open for now until I've had a chance to work on the planned performance optimizations.

@saqimtiaz
Copy link
Owner

saqimtiaz commented Jan 5, 2021

In Streams 0.2 (still in preview, code in performance branch), rendering time for very large streams is reduced by over 3 fold.

You can compare the rendering time for the tiddler "TiddlyWiki Toolmap" on the old version versus the new one.

There should be significant refresh performance improvements as well.

@saqimtiaz
Copy link
Owner

Streams 0.21 is now available and has significant performance improvements. Let me know if you still have any issues with performance.

@pmario
Copy link

pmario commented May 25, 2021

One surprising finding: using the Vanilla theme with enabled Sticky titles causes [[200]subtract<currentTiddler>] (in wiki/tiddlers/$__themes_tiddlywiki_vanilla.json) to be reevaluated. Adding a single character increases the counter by exactly 300 invocations.

Oh wow. If that happens without any plugins, I highly recommend reporting an issue at https://github.com/Jermolene/TiddlyWiki5

I know, where this comes from. It's how the "sticky titles" CSS is created. It uses z-index.

It's the dynamic CSS creation in $:/themes/tiddlywiki/vanilla/sticky ... May be we should "hardcode" those settings in the tiddler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants