1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-14 14:27:16 +00:00

Optimise variable prototype chain handling

With this improvement and 53d229592d I'm measuring a 10-15% performance improvement between v5.2.3 and master using https://github.com/Jermolene/tiddlywiki-performance-test-rig
This commit is contained in:
jeremy@jermolene.com
2022-09-24 08:28:16 +01:00
parent 0a00da6db9
commit 81ac987484
2 changed files with 8 additions and 4 deletions

View File

@@ -39,7 +39,10 @@ Compute the internal state of the widget
ImportVariablesWidget.prototype.execute = function(tiddlerList) {
var widgetPointer = this;
// Got to flush all the accumulated variables
this.variables = new this.variablesConstructor();
this.variables = Object.create(null);
if(this.parentWidget) {
Object.setPrototypeOf(this.variables,this.parentWidget.variables);
}
// Get our parameters
this.filter = this.getAttribute("filter");
// Compute the filter