yayaya! I actually try to follow a more rigorous style. 1. test 2. consistent methodology 3. results People tend to just mix 1 + 2 and not consider the implications of that (say local host testing).
It would be extremely interesting to rebuild your TS server that you used to compare against GO and Rust in Bun. I think everyone would love to know what percentage of requests would be within acceptable ms using Bun instead of Node
@@ThePrimeagen see is there any reason to ever build rust servers if go servers are just that good in every case except the most extreme teams? Since go is usually faster and rust code needs to be really good to beat it doesn't it just make since to write go code for most code bases?
Zig is basically C, but the shotgun is a boomerang. Jokes aside, after looking at how well Zig integrates with C, assembly and adds neat features to C, I'm sure it will have a certain niche as a C replacement for hardcore nerds. The nerds who love cool, weird and at the same time incomplete languages like Vala or Julia, for example.
I tried many new C/C++ like languages and zig is subjectively the most fun to use, the most readable and do-not-get-in-your-way language. Also it comes with toolchain that makes it really easy to work with C/C++ libraries and mix code.
Golang is also very strict. A thread locking a mutex twice is doomed to be a dead lock. Unlocking a not locked mutex is a Go panic. Both are programming errors. I try to implement something like async/await for QML and Go, stop at a QML-Dialog in your code and wait for the result before proceeding. You can still have callbacks/signals, but for dialogs it is much more convenient to hold your program (thread) until there is a result.
Node is a great beginner language that's for sure. It can perform relatively well enough by scaling up more instances but will be pricier over big load. ❤️ for Golang for an easy learning curve and being much more BLAZINGLY FAST.
what I liked the most about bun is that you can write typescript and JSX and just RUN IT!!!!!!!! without any pre configuration files being all over the place! It feels like this is what javascript or node should have been like since the beginning.
What I like the most about rust is not even the speed. Is how little we have to worry about keeping our software updated in comparison to node dependencies. Often we can keep using the same code for 3-5 years with no worries about backwards compatibility. The only changes needed are the security updates. No breaking changes come.
Could you compare the performance of Kotlin and Golang? Kotlin has coroutines which are very similar to goroutines, it simply multiplexes jobs to threads. But it offers structural concurrency which is the greatest thing I've seen lately.
Be interesting to see how much of the js/rust difference is due to the difference in queue implementations; VecDeque uses a ring buffer which will avoid memory allocation and garbage collection entirely once it reaches steady state, whereas your JS implementations use linked lists with dynamic allocation for all enqueues, which will dramatically increase GC pressure.
I’m frontend dev and I love how other roasts JavaScript and its entire ecosystem as well as the framework-mania. I think we worked hard enough and we fully deserved it 😂. I’m discovering Rust currently and make the same with Go last year to get a picture of both. One thing I don’t yet get is a web development (client) using one of these languages. At the first sight it looks to be too complex and bloated. For running an API server I wanted Go to replace my Node instance immediately 😅.
Most of our batch servers / micro services at my company are Spring boot and I’ve suggested multiple times that we can consider Go as a way for front end devs familiar with Typescript to relatively easily make contributions to servers but the overwhelming pushback is - Node and Java are easy to hire people for.
i hate that argument. i think go is really getting easier to hire for every day. Plus there is a TON of devs who don't want to keep getting javascripted
Thanks for the video. Just a comment on speed for bigger websites... For bigger websites it is very likely that there are multiple replicas the API endpoints. Like with Kubernetes (but not necessarily) and a load balancer on top. So if performance is a problem... 1. You can scale vertically with a bigger machine 2. You can indeed use a faster technology (rust,...) 3. You can scale horizontally and increase the number of replicas It doesn't mean that you should not use Rust, it's just that if you hit bottleneck with Node or other technologies there are other options.
this is true. but horizontal scaling as a solution is coming to an end. Its already started to get squeezed in certain geographic regions and I do not see a slow down. Vertical scaling will become the new norm and node is very tricky with state to vertically scale. Also you get a ton less for your buck on vertically scaling.
My favorite thing about this video is prob all the times you say..."Que"...I'll wait for it.....🤣😂! Good stuff as usual ! The fact that I have to literally take notes when I watch your videos should say something...So...Go, Rust, and now Bun (Typescript)..Bruh im just getting my feet wet with React....and its no even mentioned. 😩. ~Cheers!
Idk why I watch all your videos since I’m literally just starting out and don’t know 95% of what’s going on lol. Love your personality/energy though and the fact that you’re actually coding and not just regurgitating generic vague advice like most popular channels.
Do you have recorded live steam where you do these kind of tests? Not saying that i doubt your test results, but I'm curious what is your process of making these test, like i wanna see the full coding, how you collect data and stuff like that.
One way around mutex could be channels. By publishing the data to a VecDeque on another thread, you may not need a lock on it as you'd have passed the ownership to the data to that thread? And run the dequeue part on this thread as well ?
Hey, nice video, for the Rust side Can you try yo open a thread for managing the vecquedeque and sending message through channels to see how it compares to the mutex?
yes, i don't need to learn javascript then. I am thinking of sticking with the elm/rust setup i have trying to learn for years. i am kind of relived. My knowledge of js is rusty now that I haven't written it for over a week now i think. ( dang i was trying say a year, but can you really escape js :/? )
7:32 depends on your definition. If your definition includes a requirement for the code to not be absolute shit, Rust is easier. The compiler won't let you ship garbage and will give you actual constructive feedback.
Is your TS queue a lock-free concurrent queue or does it work because it is single threaded anyways? Is peeking really necessary or could it be avoided, peeking seems kind of impossible in a lock free context to me as a dequeue could happen in an ABA scenario?
Hi, nice video. Could you do a part 2, adding Python, GoLang, and Zig to this graph comparison? I think it would be nice to see, just out of curiosity.
Can we make sure the tests are not utilizing multi-CPUs? I saw a test comparing Golang with Nodejs but when they reduced the CPUs of golang down to 1, go and nodejs were not very different.
Would you like me to do add in Zig + Go?
Yes
Yes
haters gonna hate blazingly fast
Please add Go !!
Yes :chad:
Zig isn't memory safe like Rust is, which I'd guess is why you're getting blazingly fast segfaults.
whats the point of zig over c++ or c then ?
God tier comment.
take off every zig
You're absolutely right, as I also seg faulted myself several times on stream
daaayum
Man... as a computer science researcher, I love your experiments! Thanks for bringing this "scientist" spirit to the public! :)
yayaya! I actually try to follow a more rigorous style.
1. test
2. consistent methodology
3. results
People tend to just mix 1 + 2 and not consider the implications of that (say local host testing).
Before: is nodejs faster than rust?? (lol no)
Now: is bun faster than rust??? (lol no, with segmentation faults)
No one can survive on TH-cam without clickbait. lmao
It would be extremely interesting to rebuild your TS server that you used to compare against GO and Rust in Bun. I think everyone would love to know what percentage of requests would be within acceptable ms using Bun instead of Node
yeah! It actually wouldn't be very hard at all because its the entry point that was different, the rest is plain ol js.
@@ThePrimeagen see is there any reason to ever build rust servers if go servers are just that good in every case except the most extreme teams? Since go is usually faster and rust code needs to be really good to beat it doesn't it just make since to write go code for most code bases?
@@KManAbout there is a reason, discord was using go backend in the past and switched to rust
@@echoptic775 sure, but 99% of us aren't Discord or at FANG scale
@@poolkrooni more like 99.99% of us almost none of use are ever going to have billions of users.
You had my hopes up for a blazingly fast second there
The old switcheroo eh?
@@ThePrimeagen Can you do a video on WASI and NodeJs?
On Theo's video had huge doubts about the claims that bun http is faster than rust. Glad to see an unbiased comparison that lives in reality
people constantly run bad experiments.
please be careful when looking at results :) Always expect a methodology.
To be fair I’m not smart enough to write the Rust code for testing comparisons
other thing with bun is, it is open to unhealthy amount of puns which will make our lifes kind of unbearable at some point
these are facts. which is why i tried to make 0
@@ThePrimeagen 6:58 "plenty of time to bake it" 😏
Writing this server app will be fun on a bun :D
Bender from Futurama has no objection :P
A revisit once bun has matured some more could be interesting. Great content as always.
yeah, i figured i would do a zig + go + bun test here in 2 weeks.
yes we need this
Bun 1.0 is out now
remove MUTEX with the Backspace button
The John carmack of our time
Zig is basically C, but the shotgun is a boomerang. Jokes aside, after looking at how well Zig integrates with C, assembly and adds neat features to C, I'm sure it will have a certain niche as a C replacement for hardcore nerds. The nerds who love cool, weird and at the same time incomplete languages like Vala or Julia, for example.
i mean julia is pretty complete yk
Good that you didn't mention Matlab
I tried many new C/C++ like languages and zig is subjectively the most fun to use, the most readable and do-not-get-in-your-way language. Also it comes with toolchain that makes it really easy to work with C/C++ libraries and mix code.
yeah! it is really fun, though i have never tried to debug/other tool it.
try Odin
Got inspired to try vim with your vids. I'm tempted to try rust now
Read the book. I know prime doesn't recommend it but it's really good.
Read “A Half Hour To Learn Rust”
"voice and energy for a political video" + "accessible semi-deep dive content for a technical video" + "editing for a social video" = awesome stuff!
Lol... I love the concession "Node is fine for the backend if your site sucks and get's no traffic and you don't care if it performs well."
Golang is also very strict. A thread locking a mutex twice is doomed to be a dead lock. Unlocking a not locked mutex is a Go panic. Both are programming errors. I try to implement something like async/await for QML and Go, stop at a QML-Dialog in your code and wait for the result before proceeding. You can still have callbacks/signals, but for dialogs it is much more convenient to hold your program (thread) until there is a result.
Hi! Waiting forward for a comparison now that Bun 1.0 is out. Thanks for your insights!
+1
+1
Node is a great beginner language that's for sure. It can perform relatively well enough by scaling up more instances but will be pricier over big load. ❤️ for Golang for an easy learning curve and being much more BLAZINGLY FAST.
Agreed. Go Lang is definitely the best choice for the balance of developer, velocity and speed
Go for the win 🥰
Node is not a language.
@@johanw2267 You're right! But JS by itself can't do much outside of the browser 🙃
@@johanw2267 Your input is pointless here sir. Keep it to yourself.
Nice to start the work week with upbeat prime energy
yayaya!
This was fantastic! also, usually I put the playback speed to 2x for most people. Max I can do is 1.5x for you and still understand. lol
i am a winner!
prime is blazingly fast
How this guy can code at this level and entertain at the same time? It is a completely different talent tree and yet he managed to do that.
Another great video. The end got me really good. Shout out to Mrs. Primeagen! 😂
ty friend
This was really informative. Can't wait for the Go and Zig comparisons as well. Thanks Prime 👍
Okay now Bun reached stable. Do it again!
DEW IT!
:soyjak: Noo, no GO comparison. How am I suppose to claim superiority online now as GO developer.
I'll be possibly doing that!
@@ThePrimeagen Great, I've never been happier!
what I liked the most about bun is that you can write typescript and JSX and just RUN IT!!!!!!!! without any pre configuration files being all over the place! It feels like this is what javascript or node should have been like since the beginning.
Yeah, that part is incredible
There is `tsup` package for node, which uses esbuild. Not sure about JSX, I use `tsup` for ad-hoc CLI scripting
I have been immediately reminded of you when I saw the BLAZINGLY FAST phrase from bun lol
How is this the first time I come across this channel! This was amazing, subbed!
tyty!
bun has a very bright future behind her
Dang, cold as ice
@@ThePrimeagen you're the one who spread the bun and show us the light.
I love these "BlazinglyFast" series so much! :D
they are most excellent
I like how you said "Real Language"
7:16 “A real language” loool
I only speak the truth
That logo made me bust out chuckling so loud i think i scared my neighbors 😅
What I like the most about rust is not even the speed. Is how little we have to worry about keeping our software updated in comparison to node dependencies. Often we can keep using the same code for 3-5 years with no worries about backwards compatibility. The only changes needed are the security updates. No breaking changes come.
but you don't HAVE to update your dependencies if you don't want to? it's the same thing...
...that's a system language vs a glue stick webpage language...
Could you compare the performance of Kotlin and Golang? Kotlin has coroutines which are very similar to goroutines, it simply multiplexes jobs to threads. But it offers structural concurrency which is the greatest thing I've seen lately.
F I R S T ?
Blazingly first
Be interesting to see how much of the js/rust difference is due to the difference in queue implementations; VecDeque uses a ring buffer which will avoid memory allocation and garbage collection entirely once it reaches steady state, whereas your JS implementations use linked lists with dynamic allocation for all enqueues, which will dramatically increase GC pressure.
I'll redo it doing a ring buffer, and in zig because I can
I would like to see Deno included in these benchmark. it's blazingly Great to use Deno.
and here i was excited about blazing fast bun, see you my friend it was nice knowing you
hah, i am going to get cancelled, arn't i?
your videos are BLAZINGLY BEAUTIFUL.
This comment is Blazingly Appreciated
Bun 1.0 just released, would like to see a rematch
I was waiting for this review. Blazingly fast!!!
there is going to be a follow up :)
I’m frontend dev and I love how other roasts JavaScript and its entire ecosystem as well as the framework-mania. I think we worked hard enough and we fully deserved it 😂.
I’m discovering Rust currently and make the same with Go last year to get a picture of both. One thing I don’t yet get is a web development (client) using one of these languages. At the first sight it looks to be too complex and bloated. For running an API server I wanted Go to replace my Node instance immediately 😅.
Really wanted to see that `aboo` method show up after `peek` dropped and got me all excited
I'm not offended by Rust jokes. It's great to make memes because people use too much "blazingly fast". Subscribed :D Have a nice day!
Most of our batch servers / micro services at my company are Spring boot and I’ve suggested multiple times that we can consider Go as a way for front end devs familiar with Typescript to relatively easily make contributions to servers but the overwhelming pushback is - Node and Java are easy to hire people for.
i hate that argument. i think go is really getting easier to hire for every day. Plus there is a TON of devs who don't want to keep getting javascripted
I can't express enough how I like Prime performance. Dude you are the best!
your channel deserves more views all around
Blazingly sad is a pretty apt description for all my projects
Thanks for the video. Just a comment on speed for bigger websites...
For bigger websites it is very likely that there are multiple replicas the API endpoints. Like with Kubernetes (but not necessarily) and a load balancer on top. So if performance is a problem...
1. You can scale vertically with a bigger machine
2. You can indeed use a faster technology (rust,...)
3. You can scale horizontally and increase the number of replicas
It doesn't mean that you should not use Rust, it's just that if you hit bottleneck with Node or other technologies there are other options.
this is true. but horizontal scaling as a solution is coming to an end. Its already started to get squeezed in certain geographic regions and I do not see a slow down.
Vertical scaling will become the new norm and node is very tricky with state to vertically scale. Also you get a ton less for your buck on vertically scaling.
I’ve been waiting for this! 😁
My favorite thing about this video is prob all the times you say..."Que"...I'll wait for it.....🤣😂!
Good stuff as usual ! The fact that I have to literally take notes when I watch your videos should say something...So...Go, Rust, and now Bun (Typescript)..Bruh im just getting my feet wet with React....and its no even mentioned. 😩.
~Cheers!
I'll love to see this test again with Bun 1.0
I was waiting for this video and I was sure that you gonna add that "Blazingly fast" even though they didn't put it
I'd like to see more frontend Primeagen in the future, please.
I subbed only because of this dudes presentation style. LOL.
Awesome! Still waiting the ELIXIR version of that other server
You PROMISED. gotta keep your promises hehe
real language master race
Bun 1.0 is out
Me: "Oh a video on Bun"
Him: "RUUUUUUUUUUUUST, fuggin mutex, seg faults in js"
Seriously though, enjoyed the content.
Awesome
"if I'm not screaming while coding, then what I'm doing with my life"
Watching this at 1.5x made my blood pressure spike.
Blazingly recived SIGSEV ( core dumped )
Blazingly Segfaulted
This feels the like the DENO Hype-train all over again
we need a jon_gjengset_pilot plugin for the next rust implementation
You said "bake" about bun.
Nice.
you are welcome
Idk why I watch all your videos since I’m literally just starting out and don’t know 95% of what’s going on lol. Love your personality/energy though and the fact that you’re actually coding and not just regurgitating generic vague advice like most popular channels.
I need to say. Since Turok 2 this is the best Primagen so far.
Edit skills Tier 3
Completely agree. Flip is getting too powerful
Man i love when u scream: blazingly faaaast ❤️❤️❤️ best content as usual! Im becomong addicted to u and theo.gg ❤️❤️❤️
:)
"the dinosaur is going extent again people !" had me.
prime is the DR disrespect of the dev world :D
I love go. I started learning it because of your videos. Would love to see a go comparison
go is up next
I switched to bun, blazingly fast got a ton of weird errors during install/run, returned to node.
switch to rocket
mmm mm mmh. I'm seeing big wins in the bun department. Yesir.
Do you have recorded live steam where you do these kind of tests?
Not saying that i doubt your test results, but I'm curious what is your process of making these test, like i wanna see the full coding, how you collect data and stuff like that.
If I say I stream one more time on twitch I swear.
@@ThePrimeagen lol sry
Love you Prime ❤
ty
Segfault in JavaScript hahahaha XD A dream come true
zig zags into segfault
Does twitch save livestream for later viewing? It is hard to catch livestreams when I live on opposite side of date line.
yes!
@@ThePrimeagen daddy i watch you later
I think he would be an actor, something like "my name is Earl"
Dayum bro... I literally thought of this video 20min ago when I was on LinkedIn
hah
5:47 ".. blazingly sadly .." 😂
Bun fails to tell you about these benchmarks... bun is cache'ing EVERYTHING.
One way around mutex could be channels. By publishing the data to a VecDeque on another thread, you may not need a lock on it as you'd have passed the ownership to the data to that thread? And run the dequeue part on this thread as well ?
Hey, nice video, for the Rust side Can you try yo open a thread for managing the vecquedeque and sending message through channels to see how it compares to the mutex?
Very informative. Please make this video with bun 1.0
yes, i don't need to learn javascript then. I am thinking of sticking with the elm/rust setup i have trying to learn for years. i am kind of relived. My knowledge of js is rusty now that I haven't written it for over a week now i think. ( dang i was trying say a year, but can you really escape js :/? )
Yeah, no matter how much I try, I tend to write TypeScript the most
@@ThePrimeagen bad habits always come back
7:32 depends on your definition. If your definition includes a requirement for the code to not be absolute shit, Rust is easier.
The compiler won't let you ship garbage and will give you actual constructive feedback.
Zig is super fast, feels good about it
That’s a blazingly fast bun spreader lol.
Lets settle! Thanks for the vid bud :)
Is your TS queue a lock-free concurrent queue or does it work because it is single threaded anyways? Is peeking really necessary or could it be avoided, peeking seems kind of impossible in a lock free context to me as a dequeue could happen in an ABA scenario?
what about Deno? does Bun beat it on this benchmark?
Betteridge's law in action
Please add the sound effects back when you say "Blazingly fast" xD
You got it chief👍🏼
Hi, nice video.
Could you do a part 2, adding Python, GoLang, and Zig to this graph comparison?
I think it would be nice to see, just out of curiosity.
what font do you use in the terminal?
Can we make sure the tests are not utilizing multi-CPUs?
I saw a test comparing Golang with Nodejs but when they reduced the CPUs of golang down to 1, go and nodejs were not very different.
Hmm very interesting. I know most people will think me the devil, but I wonder where Java would fit into this perf model.