Lag in edit-text widget

138 views
Skip to first unread message

clutterstack

unread,
Apr 1, 2021, 8:53:32 PM4/1/21
to TiddlyWiki
Hi all,

I've been trying all sorts of things to make typing in my personal plugins less laggy, and I've realised that all I have to do to make typing laggy is to do it within an edit-text widget in view mode, no plugin required. I can get down to 5fps typing in an edit-text widget in a new tiddler on tiddlywiki.com (it's almost 10x as fast in the normal tiddler editor).

Has anyone else noticed this? Is this a well-known thing? I haven't found a lot of clues but my google-fu may be weak today.

Thanks,
Chris

Mark S.

unread,
Apr 1, 2021, 9:54:17 PM4/1/21
to TiddlyWiki
Are you trying to edit text or fields in the SAME tiddler that your edit widget is in? Because that will cause problems. You have to edit the contents of some other tiddler.

clutterstack

unread,
Apr 1, 2021, 10:16:20 PM4/1/21
to TiddlyWiki

Thanks, Mark. No, I used a separate state tiddler. It works fine, it's just a bit hard to type. I've typed a huge amount into laggy widgets over the past year; I just thought it was my fault and that I'd fix my plugins eventually. Now I'm not sure I can fix them without getting "closer to the metal."

Mark S.

unread,
Apr 1, 2021, 11:30:30 PM4/1/21
to TiddlyWiki
I'm usually the one complaining about typing speed!

If your "recent" list is open, close it and have the "open" tab open instead -- rendering that long list slows down things. Same thing if you have a lot of tiddlers open. 

Another strategy is to use a separate, semi-empty TW for data entry. Then drag and drop your finished tiddler(s) into your working TW.

There is a setting that supposedly relates to typing speed, but I never found that changing it helped much.

Hubert

unread,
Apr 2, 2021, 5:36:04 AM4/2/21
to TiddlyWiki
Hi Clutterstack,

Try addding this field to your state tiddler: throttle.refresh

I'm using TW quite heavily on mobile (in addition to desktop) and after raising issues regarding typing performance on mobile Jeremy was kind to add a throttle.refresh setting (code), starting with TiddlyWiki version 5.1.22 (if I remember correctly).

The way it works for me (as in, issue solved permanently) is that my edit-text widgets use "$:/typing" as the target tiddler to type into. That tiddler has the field "throttle.refresh" with the value "$:/typing". Performance is comparable to the one you get when typing in edit mode.

One thing to remember is that although you can now experience lag-free typing, your changes won't be committed until the wiki can actually refresh. So, I'm wrapping my edit-text widgets in a keyboard widget that listens for the enter key. When I'm done typing and hit enter, then an action widget populates the value taken from the "$:/typing" tiddler into a tiddler of choice and the $:/typing tiddler itself is cleared.

It's smooth and easy but you lose the possibility of searching with live updating. It all depends on what is more important to you. I personally aim for peak performance, whether desktop or mobile and this solution provides that.

Hope this helps. Please let me know if you need any help with this or any example code, etc.

Cheers,
-Hubert

PMario

unread,
Apr 2, 2021, 7:44:52 AM4/2/21
to TiddlyWiki
Hi,
If you go to tiddlywiki.com and edit there. Do you have the same problem. ... If yes, ... it is a problem. If no it's your wiki
-m

Ste

unread,
Apr 2, 2021, 7:49:31 AM4/2/21
to TiddlyWiki
Have you tried typing more slowly? ;)

clutterstack

unread,
Apr 2, 2021, 8:01:15 AM4/2/21
to TiddlyWiki
@Mark and @Hubert -- so frustrated with myself that I couldn't find your previous discussions last night. Thanks

clutterstack

unread,
Apr 2, 2021, 8:28:33 AM4/2/21
to TiddlyWiki
Thank you, Hubert! This is the key I needed to find. I have in fact seen the thread you linked, and because I didn't understand it (it didn't affect the frequency of TIddlyWeb messages/saves, which was my focus at the time), I kind of set it aside. I have my main wiki's $:/config/Drafts/TypingTimeout set to four seconds, but I missed how it worked with state tiddlers.

I've tried it on tiddlywiki.com, and it did make a difference. So even if I have other speed issues to deal with, at least this mystery is solved. It was driving me bonkers that I couldn't see why a draft tiddler was smooth and an arbitrary edit-text widget was not (on my hardware and software). Such a relief. Thanks again Hubert (and Jeremy) for already having worked on this, and for the excellent answer above.

If I had searched properly in this group, I would have seen your title, nearly identical to mine. 

Best wishes,
Chris

clutterstack

unread,
Apr 2, 2021, 8:31:19 AM4/2/21
to TiddlyWiki
Thanks, Mario. I know some things are not optimised on my wiki, but the lag was similar on tiddlywiki.com, and that was what really surprised and confused me.

Best wishes,
Chris

clutterstack

unread,
Apr 2, 2021, 8:31:50 AM4/2/21
to TiddlyWiki
@Ste ha ha ;)

On Friday, April 2, 2021 at 7:49:31 AM UTC-4 Ste wrote:
Reply all
Reply to author
Forward
0 new messages