Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
- name: Install dependencies
run: npm i --ignore-scripts

- name: Build SvelteKit
working-directory: benchmarks/sveltekit-app
run: npm run build

- name: Run benchmarks
run: npm start y 100 10 40

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,6 @@ profile*

# benchmark results
results

benchmarks/sveltekit-app/build/
benchmarks/sveltekit-app/.svelte-kit/
7 changes: 7 additions & 0 deletions benchmarks/sveltekit-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "sveltekit-benchmark",
"type": "module",
"scripts": {
"build": "vite build"
}
}
11 changes: 11 additions & 0 deletions benchmarks/sveltekit-app/src/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body>
%sveltekit.body%
</body>
</html>
5 changes: 5 additions & 0 deletions benchmarks/sveltekit-app/src/routes/+server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { json } from "@sveltejs/kit";

Check failure on line 1 in benchmarks/sveltekit-app/src/routes/+server.js

View workflow job for this annotation

GitHub Actions / Test (24)

Extra semicolon

Check failure on line 1 in benchmarks/sveltekit-app/src/routes/+server.js

View workflow job for this annotation

GitHub Actions / Test (24)

Strings must use singlequote

export function GET() {

Check failure on line 3 in benchmarks/sveltekit-app/src/routes/+server.js

View workflow job for this annotation

GitHub Actions / Test (24)

Missing space before function parentheses
return json({ hello: "world" });

Check failure on line 4 in benchmarks/sveltekit-app/src/routes/+server.js

View workflow job for this annotation

GitHub Actions / Test (24)

Extra semicolon

Check failure on line 4 in benchmarks/sveltekit-app/src/routes/+server.js

View workflow job for this annotation

GitHub Actions / Test (24)

Strings must use singlequote
}
12 changes: 12 additions & 0 deletions benchmarks/sveltekit-app/svelte.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import adapter from "@sveltejs/adapter-node";

Check failure on line 1 in benchmarks/sveltekit-app/svelte.config.js

View workflow job for this annotation

GitHub Actions / Test (24)

Extra semicolon

Check failure on line 1 in benchmarks/sveltekit-app/svelte.config.js

View workflow job for this annotation

GitHub Actions / Test (24)

Strings must use singlequote

/** @type {import('@sveltejs/kit').Config} */

const config = {
kit: {
adapter: adapter(),

Check failure on line 7 in benchmarks/sveltekit-app/svelte.config.js

View workflow job for this annotation

GitHub Actions / Test (24)

Unexpected trailing comma
},

Check failure on line 8 in benchmarks/sveltekit-app/svelte.config.js

View workflow job for this annotation

GitHub Actions / Test (24)

Unexpected trailing comma
};

Check failure on line 9 in benchmarks/sveltekit-app/svelte.config.js

View workflow job for this annotation

GitHub Actions / Test (24)

Extra semicolon

export default config;

6 changes: 6 additions & 0 deletions benchmarks/sveltekit-app/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [sveltekit()],
});
4 changes: 4 additions & 0 deletions benchmarks/sveltekit.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createServer } from "node:http";
import { handler } from "./sveltekit-app/build/handler.js";

createServer(handler).listen(3000, "127.0.0.1");
1 change: 1 addition & 0 deletions lib/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const packages = {
restana: { hasRouter: true, package: 'restana' },
restify: { hasRouter: true },
'srvx': { package: 'srvx' },
'sveltekit': { hasRouter: true, package: '@sveltejs/kit' },
'trpc-router': { extra: true, hasRouter: true, package: '@trpc/server' },
'whatwg-node-server': { package: '@whatwg-node/server' },
}
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"@hapi/hapi": "^21.1.0",
"@hono/node-server": "^1.3.0",
"@koa/router": "^14.0.0",
"@sveltejs/adapter-node": "^5.4.0",
"@sveltejs/kit": "^2.49.1",
"@tinyhttp/app": "^3.0.1",
"@trpc/server": "^11.1.0",
"@whatwg-node/server": "^0.10.6",
Expand Down Expand Up @@ -73,6 +75,8 @@
"restify": "^11.0.0",
"router": "^2.2.0",
"srvx": "^0.9.4",
"svelte": "^5.45.5",
"vite": "^7.2.6",
"x-xss-protection": "^2.0.0"
},
"devDependencies": {
Expand Down
Loading