mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-10-04 15:11:41 +00:00
Optimise sameday filter
I used this test:
console.time();for(var t=0; t<200; t++)
{$tw.wiki.filterTiddlers("[all[tiddlers+shadows]sameday[20170210]]");};c
onsole.timeEnd()
Before this patch, I got speeds of approx 190ms, versus 140ms
afterwards.
Note that the ability to add a cache property like this is only
possible because tiddler objects are immutable.
This commit is contained in:
@@ -827,6 +827,7 @@ taking precedence to the right
|
||||
*/
|
||||
$tw.Tiddler = function(/* [fields,] fields */) {
|
||||
this.fields = Object.create(null);
|
||||
this.cache = Object.create(null);
|
||||
for(var c=0; c<arguments.length; c++) {
|
||||
var arg = arguments[c],
|
||||
src = (arg instanceof $tw.Tiddler) ? arg.fields : arg;
|
||||
|
||||
Reference in New Issue
Block a user