Typing frozen for 45 seconds when changing title, huge number of Relink orphans

hi,
I know, I’m late to the story, but I did try to recreate a wiki similar to yours in case of numbers.

  • 14500 tiddlers and the size of 27MByte.
  • Every tiddler has 4 links to other tiddlers
    • 90% of linked tiddlers do exist
    • 10% do not, so there should be a good variety

Renaming a title needs about 3 seconds the first time.
So my testcase is definitely not sufficient to reproduce your problem.

So I would like to better understand the structure of your tiddlers.

  • How many links to other tiddlers do you have in 1 tiddler
  • Do you use macros, that contain links to tiddler titles, so relink needs to check them
    • If yes - How many custom macros do you use?
  • Is it possible to name the plugins you use
    • This may give us some info about which macros are in use.

-mario

@Flibbles … What is the most time consuming “relink” action? So I may be able to include it in the code that creates the test tiddlers.

Click to see the code to create test tiddlers from the dev-console
var ntext = "" +
/* The next line can be copy / pasted, to make the wiki bigger */
  "123456789 123456789 123456789 123456789 " + "123456789 123456789 123456789 123456789 " +
  "123456789 123456789 123456789 123456789 " + "123456789 123456789 123456789 123456789 ";

var xtext = "" +
  "123456789 123456789 123456789 123456789 " + "123456789 123456789 123456789 123456789 " +
  "123456789 123456789 123456789 123456789 " + "123456789 123456789 123456789 123456789 ";

var tiddler = $tw.wiki.getTiddler("GettingStarted");
var aliases = "";
var x = 0;
for (var x = 0; x < 13; x++) {
  for (var i = 0; i < 35; i++) {
    tag = "t-" + i;
    for (var k = 0; k < 32; k++) {
      aliases = "a-" + x + "-" + i + "-" + k;
      $tw.wiki.addTiddler(new $tw.Tiddler(tiddler, {
        title: "x-" + x + "-a-" + i + "-" + k,
        text: ntext + " [[" + "x-" + x + "-a-" + (i-1) + "-" + k + "]] " + " [[" + "x-" + x + "-a-" + (i+1) + "-" + k + "]] " + 
              xtext + " [[" + "x-" + x + "-a-" + i + "-" + (k-1) + "]] " + " [[" + "x-" + x + "-a-" + i + "-" + (k+1) + "]] ",
        tags: [tag],
        aliases: aliases
      }/*, $tw.wiki.getModificationFields()*/));
    }
  }
}

@pmario Thank you so much.

  • How many links to other tiddlers do you have in 1 tiddler

Is there a code I can use to find which of my tiddlers have the most links to other tiddlers?

  • Do you use macros, that contain links to tiddler titles, so relink needs to check them
    • If yes - How many custom macros do you use?
  • I think custom macros may turn out to be the problem. I thought I had gotten rid of all modifications by porting all non-system tiddlers over to an empty Tiddlywiki, but no, I just now found some book quote macros that are evidently not considered system tiddlers. And I know I have journal and reading history macros. I found some by searching in my Tiddlywiki using keywords like “quotes” and “macro”. I will also look up all my old forum posts to find code I was given in the past. It will take me some time to discover them all and try turning them off by enclosing them in formatting boxes. Will keep you updated.

  • I heavily use Subsume list filters to organize my wiki instead of TOCs, but I’ve been doing that for some time:

<$list filter="[tag[REPLACE]sort[title]]">
<$macrocall $name=subsume tid=<<currentTiddler>>/>
</$list>

Is it possible to name the plugins you use

I already tried putting all my non-system tiddlers in an empty Tiddlywiki with no plugins (except Relink) and the problem persisted. I will now focus on turning off the macros as I am now going forward with the “no plugin” fork. (It has relink and subsume back in there now though!)

@pmario, the most expensive operation Relink performs is indexing. This occurs the first time the “Relink References” panel is opened, or a character in a tiddler you’re editing is modified (but before the save). It sounds like @Sapphireslinger isn’t using the “Relink References” panel, and it’s all about typing that first character into the title bar of that first tiddler.

@Sapphireslinger, so to make sure I understand, that 45 second delay is occurring the first time only? Or it’s occurring every time you try to edit a tiddler’s title?

…Actually, looking back up, I’m seeing you’re saying the delays happen when saving or opening tiddlers. Which makes no sense to me. Relink isn’t supposed to be doing anything at those time. Is that really when it’s happening?

You can find a pre 2.0 version of Relink here. Just save that file to your desktop and then drag it over. This is the version from before I switched over to using a TW indexer internally… which was a change I made to improve performance :confused:

It won’t have support for the latest Tiddlywiki 5.3.x stuff, but there shouldn’t be any major bugs.

It’s not needed to be exact. I only wanted to have an estimate. Is it 5, 10 or 100 links. As I wrote my test tiddlers use 4 links at the moment and the indexing seems to need maximum 3 seconds on my machine.

Which version of the subsume macro do you use? I think subsume is a plugin. I found this version: The Subsume Plugin — Turn links into sliders! linked from this thread: [tw5] Reboot of Subsume plugin

I do not use it, so I’ll need some time to investigate the mechanism and see if I can come up with auto-created test tiddlers.

How many subsume macros do you have in 1 tiddler - in average?