pull/14361/head
Dominic Gannaway 2 years ago
parent 18751cc381
commit 07505fe0c6

@ -1,7 +1,4 @@
import {
kairo_avoidable_owned,
kairo_avoidable_unowned
} from './kairo/kairo_avoidable.js';
import { kairo_avoidable_owned, kairo_avoidable_unowned } from './kairo/kairo_avoidable.js';
import { kairo_broad_owned, kairo_broad_unowned } from './kairo/kairo_broad.js';
import { kairo_deep_owned, kairo_deep_unowned } from './kairo/kairo_deep.js';
import { kairo_diamond_owned, kairo_diamond_unowned } from './kairo/kairo_diamond.js';

@ -1,6 +1,3 @@
import { wrapper_bench } from "./wrapper/wrapper_bench.js";
import { wrapper_bench } from './wrapper/wrapper_bench.js';
export const ssr_benchmarks = [
wrapper_bench
]
export const ssr_benchmarks = [wrapper_bench];

@ -1,34 +1,31 @@
<script>
const wrapperWidth = 960
const wrapperHeight = 720
const cellSize = 10
const centerX = wrapperWidth / 2
const centerY = wrapperHeight / 2
const wrapperWidth = 960;
const wrapperHeight = 720;
const cellSize = 10;
const centerX = wrapperWidth / 2;
const centerY = wrapperHeight / 2;
let angle = 0
let radius = 0
let angle = 0;
let radius = 0;
let tiles = []
const step = cellSize
let tiles = [];
const step = cellSize;
while (radius < Math.min(wrapperWidth, wrapperHeight) / 2) {
let x = centerX + Math.cos(angle) * radius
let y = centerY + Math.sin(angle) * radius
while (radius < Math.min(wrapperWidth, wrapperHeight) / 2) {
let x = centerX + Math.cos(angle) * radius;
let y = centerY + Math.sin(angle) * radius;
if (x >= 0 && x <= wrapperWidth - cellSize && y >= 0 && y <= wrapperHeight - cellSize) {
tiles.push({ x, y })
}
if (x >= 0 && x <= wrapperWidth - cellSize && y >= 0 && y <= wrapperHeight - cellSize) {
tiles.push({ x, y });
}
angle += 0.2
radius += step * 0.015
}
angle += 0.2;
radius += step * 0.015;
}
</script>
<div id="wrapper">
{#each tiles as { x, y }}
<div
class="tile"
style="left: {x.toFixed(2)}px; top: {y.toFixed(2)}px;">
</div>
{/each}
{#each tiles as { x, y }}
<div class="tile" style="left: {x.toFixed(2)}px; top: {y.toFixed(2)}px;"></div>
{/each}
</div>

@ -1,14 +1,14 @@
import { render } from "svelte/server";
import { fastest_test, read_file, write } from "../../../utils.js";
import { compile } from "svelte/compiler";
import { render } from 'svelte/server';
import { fastest_test, read_file, write } from '../../../utils.js';
import { compile } from 'svelte/compiler';
const dir = `${process.cwd()}/benchmarking/benchmarks/ssr/wrapper`
const dir = `${process.cwd()}/benchmarking/benchmarks/ssr/wrapper`;
async function compile_svelte() {
const output = compile(read_file(`${dir}/App.svelte`), {
generate: 'server'
});
write(`${dir}/output/App.js`, output.js.code)
write(`${dir}/output/App.js`, output.js.code);
const module = await import(`${dir}/output/App.js`);
@ -19,12 +19,12 @@ export async function wrapper_bench() {
const App = await compile_svelte();
// Do 3 loops to warm up JIT
for (let i = 0; i < 3; i++) {
render(App)
render(App);
}
const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
render(App)
render(App);
}
});

Loading…
Cancel
Save