When you use [all[tiddlers+shadows]] (means all tiddlers in wiki) the code makes TW slow. You may have suggestion to improve the performance by using simpler code, and better algorithm. Here the filter is calculated in several parts! I used the $set to calculate the filter once, but it does not make a big difference with respect the current code.
Important Notes
1: The performance on official Tiddlywiki with around 4000 tiddlers is fantastic.
2. On a Tiddlywiki with ~36000 tiddler you will see the slowness of TW with [all[tiddlers+shadows]]
Can you post a demo that shows the performance issues? At a very quick glance I see some redundant sorting happening, and some sorting that would be better done after you have just the number of years left rather than sorting all tiddlers upfront.
Mohammad thanks for sharing this, I can see it being of great use especially on long running personal wikis. I particularly like the application of the subfilter. As we become advanced filter users sometimes it is just as easy to enter a filter to get exactly what we want.
A Possible future inclusion:
Advanced Search > Filter > Dropdown Allows you to select from tiddlers tagged $:/tags/Filter containing a description and filter field.
Perhaps this drop down could be used to set the filter in the history sidebar.
I think we could make a few UI items to allow selection of filters from such filter tiddlers, and creating a new filter tiddler from a filter.
Yes, but then the filter makes all the difference. If the “sub filter” constrains the output then performance should be fine.
Its fine to include a warning notification, even a confirm widget before setting this to all.
If the tab is not active or sidebar shut this will not be refreshed as a result of changes in the wiki.
We should not abandon flexibility just because something may take a while, but we can protect someone from asking “too much” via advice rather than blocking.
You could also set a limit (that can be changed to a large number eg 1000)
Hi Tony,
I have updated the code with default to All years.
I have implemented the comments by @saqimtiaz
See the OP with updated code.
Still for filters like [all[tiddlers+shadows]] are pretty slow.
Strangely when you have alot of output, typing is inputbox is very laggy! This is while nothing changes for macro computing the results. I suspect that the $let may get refereshed abd cause such lags. This can be obsered when you use [all[tiddlers+shadows]] in TiddlyWiki — a non-linear personal web notebook
Note: Press Enter (shortcut) does the same actions as Set filter button.
Likely due to the sheer number of links rendered that then need to be checked for a potential refresh. Trying using a $:/temp/volatile/ prefix for the tiddler connected to the input or give it the field throttle.refresh.
Some other thoughts:
Displaying all years by default probably isn’t the best idea from a usability perspective either.
Avoid text substitution in your macros, using filters to concatenate strings instead.
One idea is to not calculate the years and months but rather use a default range of years/months.
A while back I created an alternative implementation of the sidebar lists for a colleague using $eventcatcher rather than creating links which also significantly improved performance.
On Chrome, using the content-visibility CSS property can also help with the initial display time for very long lists.
What is the use case for including shadow tiddlers? Most shadow tiddlers do not have a modified date.
Since we’re on the topic of modified recent tabs, is there a way to have the recent tab to use the caption field with the title in <small class="tc-muted"></small>, or if there is none to use just the title?
(Along with the ability to search by month of course, as that is a very neat feature!)
Why not clone recent tab and make your own? I think this is possible and I have seen solution in forum! Check also https://groups.google.com/g/tiddlywiki
Yes I understand it would be slow, but I am unlikely to ever use that myself ( I don’t think others would either), even while coding I would be happy with the year based limits.
It is only when you are using a “sub filter” that restricts the output that one may want to see multiple years or all years.
This highlights the dilemma that emerges where a tool allows a freeform filter field, it tends to give people enough rope to do what they want and to hang themself.
I think just grabbing any old filter is not enough to understand the real world use. Remember there are a lot of almost irrational things we can do in tiddlywiki to cause a performance problem, the question is how much cotton wool we wrap around our solutions.
What If counting the number of items using the current filter is quick but the display of a large list is not quick?, perhaps the “all years” button only appears if there are less than 100 items? It is only when there are some items across multiple years when the all years becomes useful, so you don’t have to select each year one after the other.
I hope other interested users apply their change and share back to us.
I think there rooms for improvement or developing another solutions based on this.
Hi, I came across this post in search for a modification of the recent tab. I want to show my newly created tiddlers of the current year filtered by month. The list should have a limit to the months shown in case there are too many tiddlers and the list gets too long (e.g. a limit of 6 out of 12 months). I tried an played around with this code from the TW documentation in a new tab but I don’t even get the original code to work. Nothing shows up and this is not the first tab I’ve added… Has anybody a working code example at hand?