-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
/// <reference lib="dom" />
import { GlobalRegistrator } from "@happy-dom/global-registrator";
import { baseline, bench, run, group } from "mitata";
import { attr, effect, el, signal } from "../../esm/es2019/ef.js";
GlobalRegistrator.register();
group("[DOM] Element creation", () => {
baseline("Manual DOM methods", () => {
const button = document.createElement("button");
button.textContent = "Button";
button.setAttribute("aria-disabled", "false");
const div = document.createElement("div");
div.appendChild(button);
});
bench("Manual DOM (innerHTML)", () => {
const div = document.createElement("div");
div.innerHTML = `<button aria-disabled="false">Button</button>`;
});
bench("Without Signal", () => {
el("div", [], [el("button", [attr("aria-disabled", "false")], ["Button"])]);
});
bench("With Signal", () => {
effect(() => {
el(
"div",
[],
[el("button", [attr("aria-disabled", signal("false"))], ["Button"])],
);
}).dispose();
});
});
await run();
GlobalRegistrator.unregister();