From 3c73774b38c458f56325f37b8243c23339fc8c5c Mon Sep 17 00:00:00 2001
From: Andrew Seier
Date: Thu, 23 Mar 2023 09:08:40 -0700
Subject: [PATCH] Improve performance of injection phase.
Just a few changes to improve the performance of going from a
user-defined template function to a clonable template element.
---
demo/performance/index.html | 6 ++
demo/performance/index.js | 129 +++++++++++++++++++++--------------
test/test-template-engine.js | 56 +++++++--------
x-element.js | 110 ++++++++++++++++-------------
4 files changed, 175 insertions(+), 126 deletions(-)
diff --git a/demo/performance/index.html b/demo/performance/index.html
index 06461d1..4b2c341 100644
--- a/demo/performance/index.html
+++ b/demo/performance/index.html
@@ -46,6 +46,12 @@
which are interpolated into a given template. This is the most common
thing the engine needs to do.
+
+ Finally, a note on how the tests work — they are batched up and run within
+ animation frames to guard against any interference that might occur when
+ an animation frame is skipped due to the main thread being busy. This is
+ why the tests all take the same amount of time to complete.
+