If you look at the code for the indexers, e.g. $:/core/modules/indexers/tag-indexer.js
, you’ll see that the index cache is only built for the set of tiddlers identified in the OP (the [all[…]] filters correspond to the various subindexers):
TagIndexer.prototype.init = function() {
this.subIndexers = [
new TagSubIndexer(this,"each"),
new TagSubIndexer(this,"eachShadow"),
new TagSubIndexer(this,"eachTiddlerPlusShadows"),
new TagSubIndexer(this,"eachShadowPlusTiddlers")
];
$tw.utils.each(this.subIndexers,function(subIndexer) {
subIndexer.addIndexMethod();
});
};
The function getTiddlersWithTag
used e.g. in the tag
filter and defined in $:/core/modules/wiki.js
makes use of these indexers:
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;
};
So, when you use the constructs described in the Performance tiddler, your filter will use the indexers and be much faster, especially for large wikis.
Have a nice day
Yaisog