Skip to content

Commit

Permalink
update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Jun 7, 2024
1 parent aeba7b8 commit cfecbb4
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions bench/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ let result = "";
const bench = new Bench({ time: 500 });

// Simple cases
bench.add("empty template", () => {
result = html``;
});

bench.add("simple HTML formatting", () => {
result = html`<div>Hello, world!</div>`;
});
Expand Down Expand Up @@ -41,7 +37,7 @@ bench.add("array expressions", () => {
</ul>`;
});

const items2 = ["Item 1", "Item 2", "Item 3"];
const items2 = ["Item 1", "Item <1.5>", "Item 2", "Item <2.5>", "Item 3"];
bench.add("array expressions with escapable chars", () => {
result = html`<ul>
${items2.map((item) => {
Expand Down Expand Up @@ -80,15 +76,6 @@ bench.add("large strings", () => {
result = html`<p>${largeString}${largeString}</p>`;
});

// High iteration count
const scriptContent =
"<script>console.log('This should not execute');</script>";
bench.add("high iteration count", () => {
for (let i = 0; i !== 100; i++) {
result = html`<span>${i}: ${scriptContent}</span>`;
}
});

// Escaped and unescaped expressions
const rawHTML = "<em>Italic</em> and <strong>bold</strong>";
const markup = "<mark>Highlighted</mark>";
Expand Down

0 comments on commit cfecbb4

Please sign in to comment.