Release: Improved performance of Kin filter

Hello everyone!

It was a long time ago when I was active in this lovely community, but now I have some free time and I would like to improve my plugins, because some of them are well known, but has performance issues: Locator and Kin filter.

As I see, there was a lot of great improvement in TiddlyWiki and it helps me to fix the performance issues in the plugins. Thanks to @Flibbles for the LinkedList, it made Kin filter really fast. Regarding to my test results (npm run test:performance in the plugin repository) the time of [[kin[TableOfContents]] filter lowered from 531ms to the impossible seeming 6ms. I’m still not sure if I did something wrong in the measurement, because I can’t believe that the filter became so fast.

I ask You to test it please and open an issue on GitHub - bimlas/tw5-kin-filter: TiddlyWiki plugin: Recursively looking for kinship between tiddlers if errors are encountered.

Demo + install: TW5 Kin filter plugin — recursively looking for kinship between tiddler titles
Repository: GitHub - bimlas/tw5-kin-filter: TiddlyWiki plugin: Recursively looking for kinship between tiddlers (please star if you like it)

PS.: I deleted the GitLab repositories of my plugins and kept only on GitHub

10 Likes

Nice to have your back @bimlas thanks for the updates. I will test in next 24hours

Hi, Nice to have you back :slight_smile:

I did create an issue at GH: Plugin should create "demo tiddlers" dynamically. · Issue #2 · bimlas/tw5-kin-filter · GitHub instead of adding them as shadows to the plugin.

-mario

I tried to run your suite. As best I can tell, you’re seeing that performance improvement probably because of the getGlobalCache call. Without it, your findListingsOfTiddlers will run through every shadow and tiddler once for every input your filter receives. With the latest change you put in, it will only be run once. So that kind of performance improvement doesn’t seem unreasonable.

@bimlas. I was looking at Locator. None of you tutorial videos work in Firefox so I fired up Edge(chromium) and then Chrome. Same issue, none of them work. :frowning:

@TW_Tones , @pmario

Nice to see you too! :slight_smile:

@pmario

I’ve got your point, will modify the example tiddlers.

@Flibbles

You are right, I just tried out to remove the cache in findListingsOfTiddlers and it became so slow.

@CodaCoder

I just tried to reproduce the steps in the video tutorial on TW5 Locator plugin — discover and search by context in Firefox, everything seems to work fine. Could you please give me an exact example what not works for you? A screencast would be even better.

I think we do need to improve the documentation a little, to include the words descendant’s, ancestor’s, because although appropriate as parameters from and to are easy to confuse.

  • I love the functionality of the kin filter including its ability to use any fieldname not only tags, however it always takes me time to write my kin filter because it is hard to visualise its result.

image

  • Personally I think the arrows in this diagram should point the other direction.

To is currently equivalent to descendants of the base
From is currently equivalent to ancestors of the base

In some ways I think these should be opposites, but perhaps it is too late now.

  • How would you word from or to in a sentence to describe them @bimlas ?

I recall a concern about the order of ancestors / descendants because they should be as found not sorted any other way.

  • For example how do we make a breadcrumb from a leafe to the root?

image

None of these videos work – they’re all 404s

@CodaCoder

I moved the demo page from GitLab to GitHub and I forgot to upload the video files, I just fixed it, you should be able to watch those.

@TW_Tones

I think it would be better to split the filter to different parts, I from and to could be separate filters. When I created the plugin, it looked okay to include everything in a single solution, but now I think it would be better to use fewer options. I will think about it, but it would lead to a rename of the project.

You may be interested in another solution taggingtree and tagstree which only work on tags, unlike kin which is more versatile.