Skip to content

Add vanilla Svelte - #6

Open
Rich-Harris wants to merge 3 commits into
eknkc:masterfrom
Rich-Harris:vanilla-svelte
Open

Add vanilla Svelte#6
Rich-Harris wants to merge 3 commits into
eknkc:masterfrom
Rich-Harris:vanilla-svelte

Conversation

@Rich-Harris

Copy link
Copy Markdown

Hey — I don't know if this is in keeping with the intent/spirit of the repo, so feel free to close, but since there's a vanilla React example in there I thought it'd be interesting to see what vanilla Svelte (i.e. without the overhead of SvelteKit's router) would look like. No streaming, since Svelte doesn't have a streaming SSR API.

image

@eknkc

eknkc commented Apr 11, 2024

Copy link
Copy Markdown
Owner

Yeah, this I also tried with similar results however just like #3 these might not be a good idea to introduce to the table as they will skew things a lot because they do sync rendering. I keep react because it handles promise resolution using Suspense boundaries, renders async (also interesting to see Next is 15x slower than that). Resolving the promise outside, I bet it will (along with vue) produce similar results.

@jamonholmgren

Copy link
Copy Markdown

IMO every competitor should be relative to React, even if faster -- so Svelte should show "Relative to React 6.22x faster".

(I know others will likely disagree, but since React is the industry leader, it makes sense to me.)

@ryoppippi

Copy link
Copy Markdown
Contributor

Is there any differece between svelte4 and 5?

@sheijne

sheijne commented Apr 13, 2024

Copy link
Copy Markdown

@eknkc SvelteKit also does sync rendering. How is that different?

Isn't the whole idea behind this benchmark to benchmark SSR performance? And not how fast frameworks and renderers can stream/resolve promises?

Edit: Tested your theory, and it turns out it is incorrect. In the result below Suspense has been removed from the React and Vue benchmarks, and resolves the promise in the handler. Vue even appears to become slower.

image image

@Inqnuam

Inqnuam commented Apr 13, 2024

Copy link
Copy Markdown

Its totally unfair to compare React to SvelteKit when we can do SSR with plain Svelte.
Thank you @Rich-Harris

@ryoppippi

Copy link
Copy Markdown
Contributor

I'm on this PR

Comment thread src/index.js
{ name: "next", handler: await buildNextHandler() },
{ name: "nuxt", handler: await buildNuxtHandler() },
{ name: "sveltekit", handler: await buildSveltekitHandler() },
{ name: "svelte", handler: await import("svelte-benchmark/build/handler.js").then((x) => x.buildHandler()) },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be group: "renderers", and sveltekit as group: "frameworks",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants