aboutsummaryrefslogtreecommitdiff
path: root/test/vdom.ffi.bench.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/vdom.ffi.bench.js')
-rw-r--r--test/vdom.ffi.bench.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/vdom.ffi.bench.js b/test/vdom.ffi.bench.js
new file mode 100644
index 0000000..a8e139e
--- /dev/null
+++ b/test/vdom.ffi.bench.js
@@ -0,0 +1,27 @@
+import { bench, describe } from "vitest";
+import { setupDOM } from "./utils";
+import { morph } from "../src/vdom.ffi.mjs";
+import { smoke_test } from "../test-apps/vdom-test-templates/build/dev/javascript/app/client_test.mjs";
+
+// BENCH ------------------------------------------------------------------------
+
+describe("vdom morph bench", () => {
+ let appEl;
+ let template;
+ bench(
+ "smoke test morph",
+ () => {
+ appEl = morph(appEl, template);
+ },
+ {
+ setup: () => {
+ const result = setupDOM();
+
+ global.Node = result.Node;
+ global.document = result.document;
+ appEl = document.getElementById("app");
+ template = smoke_test();
+ }
+ }
+ );
+});