TiddlyWiki / TiddlyDesktop

A custom desktop browser for TiddlyWiki 5 and TiddlyWiki Classic, based on nw.js
1.72k stars 121 forks source link

"Create new wiki" extremely slow on MacOS #266

Open michaeljmcd opened 1 year ago

michaeljmcd commented 1 year ago

Running TiddlyDesktop v0.0.16 on macOS Ventura 13.1, creating a new wiki ("Create new wiki" > "Empty tiddly wiki file") runs extremely slowly. It takes over 10 minutes to complete. If I check the create directory, I see a small (600-700kb) file created right away and then the full wiki much later (the first time I noticed this, I assumed it would never complete, deleted the file and a broken wiki window popped up minutes later).

Some other notes:

image

Jermolene commented 1 year ago

Thanks @michaeljmcd. I'm also on Ventura 13.1 with decent download speeds, and I'm seeing the same 10s or more delay when creating a new wiki. As you say, the new wiki is being downloaded from the internet, but it shouldn't be that slow. I assume there's a problem with the code that downloads and saves the file. I'll investigate.

https://github.com/TiddlyWiki/TiddlyDesktop/blob/d69d07395c6228288c11809775ed3c961edf6f3b/source/js/window-list.js#L220-L233

After the wiki does create, it gets rendered strangely into the UI.

That seems to be a layout issue if the window is too narrow – @Telumire might that be related to the recent CSS updates?

Telumire commented 1 year ago

Hi @Jermolene ! I tried to reproduce the issue with the latest release (tiddlydesktop-win64-v0.0.16) but the creation of a new wiki take about 1 or 3 seconds, which is about the same delay than what I'm accustomed to. Beside the only thing that I modified for the update was the tiddlers relate to the wiki list so I dont see how this could impact the creation of a new wiki ? I'm on windows 10 by the way, maybe this has something to do with nw.exe ?

https://user-images.githubusercontent.com/31185220/212408966-208a1289-83a3-4dd2-9a32-044dffbf8bcd.mp4

And the UI looks fine on my side:

image

Jermolene commented 1 year ago

Apologies @Telumire – I think the 2nd issue (the one illustrated by @michaeljmcd in the OP) is actually a long-standing layout issue that is triggered when the wikilist window is too narrow to fit the pathname. Presumably the fix is to turn on CSS wordwrap for those strings.

The 1st issue (the performance of downloading an empty wiki from tiddlywiki.com) appears to only affect macOS.

Jermolene commented 1 year ago

The 1st issue (the performance of downloading an empty wiki from tiddlywiki.com) appears to only affect macOS.

To verify that the problem doesn't lie with the https://tiddlywiki.com infrastructure, I added a new template with a TiddlyHost wiki as the URL, and still experienced the same stalling in the download. I'll try upgrading to the latest nw.js.

JHonaker commented 1 year ago

The 1st issue (the performance of downloading an empty wiki from tiddlywiki.com) appears to only affect macOS.

@Jermolene I can add some evidence that it's not isolated to macOS. I have a Windows 10 machine for work. The "Create from a Template" buttons for both prerelease and release create a 0 byte file immediately, but I haven't been able to successfully download a wiki via them.

Adding a wiki file that's been downloaded externally works perfectly well though.