Great to see something so clear! On Thursday, 26 September 2019 00:18:32 UTC+2, Arlen Beiler wrote: > > Ok, I found the offending line! And I double-checked that one line using > Date.now() and it literally does take six seconds. It varies by about 400 > ms from one time to the next, but that's completely accurate! Note that the > line is executed many times during the sort and that is the total execution > time for that line for one sort operation. > > [image: Screenshot 2019-09-25 18.02.35.png] > > On Wed, Sep 25, 2019 at 5:58 PM Arlen Beiler <[email protected] > <javascript:>> wrote: > >> When I step over the line it takes six seconds to show up for the next >> line. However, when I run a performance profile of the page and do exactly >> one action -- opening the control panel -- it still takes about 6 seconds >> but the performance profile shows thousands of refresh calls down the >> widget tree one after the next for six seconds. It blames the whole thing >> on sortByList, and specifically the replaceItem function inside it, but I'm >> still investigating it. >> >> On Wed, Sep 25, 2019 at 4:12 PM Jed Carty <[email protected] >> <javascript:>> wrote: >> >>> It is used here: >>> >>> exports.getTiddlersWithTag = function(tag) { >>> // Try to use the indexer >>> var self = this, >>> tagIndexer = this.getIndexer("TagIndexer"), >>> results = tagIndexer && tagIndexer.subIndexers[3].lookup(tag); >>> if(!results) { >>> // If not available, perform a manual scan >>> results = this.getGlobalCache("taglist-" + tag,function() { >>> var tagmap = self.getTagMap(); >>> return self.sortByList(tagmap[tag],tag); >>> }); >>> } >>> return results; >>> }; >>> >>> which caches the results to make it faster afterward, this works well >>> for when a tag isn't on too many tiddlers, but I have no idea what 'too >>> many' is here. >>> >>> I haven't dug too deeply into the cache mechanism and there may be some >>> maximum size after which it won't cache results, if that is the case than >>> it may have to build the results every time the tag is looked up instead of >>> being able to use the cached result. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "TiddlyWiki" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected] <javascript:>. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/tiddlywiki/160dda32-67cc-4078-b76a-3e2408239d99%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/tiddlywiki/160dda32-67cc-4078-b76a-3e2408239d99%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>
-- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c68e891f-f2d3-4c68-881e-8c4438e68f87%40googlegroups.com.

