Make Your SvelteKit Code 10x Faster With Rust and WebAssembly

preview_player
Показать описание
📝 In this video, I go over how to make your SvelteKit code faster by using Rust and compiling it to WebAssembly.


💡 What if you could boost your SvelteKit applications' speed and improve efficiency like never before? This video will teach you how to leverage Rust and WebAssembly in your SvelteKit projects, unlocking a new level of speed and performance. From setting up your environment to deploying your ultra-fast apps, I've got you covered!

🔬 By introducing Rust and WebAssembly to your SvelteKit coding arsenal, not only will you witness faster code execution, but you'll also experience better safety and less memory use. I'll guide you through step-by-step instructions on how to seamlessly integrate these technologies into your existing SvelteKit projects.

Don't forget to hit the like button, subscribe to our channel, and turn on the notification bell 🔔 to stay updated with our latest videos on Svelte and other exciting web development topics 🚀.

Chapters:
00:00 - Intro
00:27 - Rewrite sum function in Rust
02:03 - Compile sum function in Rust into WebAssembly
02:56 - Import WebAssembly into SvelteKit
04:13 - Comparing JavaScript with WebAssembly
Рекомендации по теме
Комментарии
Автор

Having a hard time thinking of a legitimate use case for this as not much is computationally intensive enough to warrant a WASM call, but nice to know it's so simple that when it does arise it's easy to add

skylark.kraken
Автор

Do I need to have blue hair or be power hungry to use Rust?

mvargasmoran
Автор

Can you make a high level overview explaining the benefits and what this is for?

I'm just a react frontend dev learning svelte and just getting into this. So I don't know what WebAssembly is used for or what the process is for all this.

JoeyAlvara
Автор

Great summary! Hoping to adopt this in my work!@!

novalanche
Автор

Have you tried writing anything in Tauri to join these two technologies for native apps? It seems like it can do a lot of this binding between the Rust backend and Svelte frontend via an event-driven system. My only issue with it is you have to serialize/deserialize data back and forth, which slows down the process considerably. I wonder if it could be compiled to WASM to avoid that issue? 🤔

JDalmasca
Автор

"Twelve years of hardware improvements down the drain" - very good point.

ArifBillahOnGoogle
Автор

This is amazing. I was dreaming to get this. I am wondering if this could be only applied for helper functions or even for state management. Besides that, how would be the TS integration? Definitely I need to dig in this since Svelte and Rust are my favourite joys programming. Thanks!!!

SilvestreVivo
Автор

What is the difference in page load size in the network tab after adding the web assembly package? (In build and preview mode?)

zachlankton
Автор

i follow your video and it work, but i saw in console log of brower, the time is the same like JS: 1.7s and WASM 1.5s. So what it mean? in Browser, may be it take time to render to user eyes?

funnynews
Автор

love you videos man. but please use a dark theme. not trynna get flash banged at 2 am

danielmontilla
Автор

This is crazy, I have to try this. Is there any way to have both the Rust and Svelte code in the same project? Seems like that could be easier than having to copy the WASM files.

roastbeefer
Автор

Is there a way to increase the font size, it's hard to read when watching on mobile.

daleryanaldover
Автор

Can you do this if your Svelte app is built in Typescript? Or must it be built in JS to compile to WASM?

Автор

why we have to use this? is it faster when we use axum for backend api and call api in +server.ts ?

fegreat
Автор

Thank you for the good introduction regarding sveltekit with wasm. however, in my benchmark wasm was not much faster than JS and sometimes even slower with larger arrays. must be the overhead, right?

folkerschellenberg
Автор

The time needed to learn Rust defies the main purpose

greendsnow
Автор

So much clickbait. This has so little with sveltekit or real-life performance improvement.

mcornholio
Автор

JS optimizer makes me cry again and again 😅 How dumb is need to be to have difference in machine code for reduce and loop! JS is pure trash

alexgorodecky