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.
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.
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.
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 ?
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.
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.
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.
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
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.
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.
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!
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.
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?
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?
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.
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.
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 :/? )
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 😅.
I tried but I am not sure what else to do to remove the Mutex's. The root of the issue is that actix uses an app data store to centralize the application data then distributes that among the helper functions that handle each route. The data parameter requires you to implement the 'FromRequest' trait that allows you to get your own data and supply the handler functions but because of the shared state the request data fed to the trait sig is immutable. As the other PR states everything in Actix data wise is wrapped in an ARC since the whole state is shared. Mutex is the only way to share the state and guarantee thread safety. You could break the rules and lazy_static the queue and use a mut ref to the global instance but I think Ferris would put you on a watch list for the rest of your life.
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).
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
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
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”
Before: is nodejs faster than rust?? (lol no)
Now: is bun faster than rust??? (lol no, with segmentation faults)
No one can survive on UA-cam without clickbait. lmao
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
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
remove MUTEX with the Backspace button
The John carmack of our time
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.
7:16 “A real language” loool
I only speak the truth
Nice to start the work week with upbeat prime energy
yayaya!
Hi! Waiting forward for a comparison now that Bun 1.0 is out. Thanks for your insights!
+1
+1
How is this the first time I come across this channel! This was amazing, subbed!
tyty!
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 👍
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.
I’ve been waiting for this! 😁
I love these "BlazinglyFast" series so much! :D
they are most excellent
Okay now Bun reached stable. Do it again!
DEW IT!
That logo made me bust out chuckling so loud i think i scared my neighbors 😅
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
I have been immediately reminded of you when I saw the BLAZINGLY FAST phrase from bun lol
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.
Can we get an updated reaction for bun 1.0? :)
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.
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."
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 ?
I was waiting for this review. Blazingly fast!!!
there is going to be a follow up :)
Love you Prime ❤
ty
your channel deserves more views all around
"the dinosaur is going extent again people !" had me.
your videos are BLAZINGLY BEAUTIFUL.
This comment is Blazingly Appreciated
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
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.
"voice and energy for a political video" + "accessible semi-deep dive content for a technical video" + "editing for a social video" = awesome stuff!
"if I'm not screaming while coding, then what I'm doing with my life"
: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 about Deno? does Bun beat it on this benchmark?
Bun 1.0 just released, would like to see a rematch
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.
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!
what font do you use in the terminal?
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...
Can you build it in C#?
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'll love to see this test again with Bun 1.0
real language master race
I like how you said "Real Language"
zig zags into segfault
Edit skills Tier 3
Completely agree. Flip is getting too powerful
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
What do you think of .net core do you think it is a worthy to compete?
Really wanted to see that `aboo` method show up after `peek` dropped and got me all excited
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!
Bun 1.0 is out
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?
Okay now. Where is bunspreader 2? I can we get updated results?
what about doing comparison with fastify instead of plain node?
5:47 ".. blazingly sadly .." 😂
Bun fails to tell you about these benchmarks... bun is cache'ing EVERYTHING.
What about svelte? I want to do my frontend in svelte, but rust is very tempting
Svelte is a framework not a runtime correct? You would still use Svelte with Bun / V8 / Deno / Node.
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.
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?
Is it really JS faster at prototyping? how long did it take to write + debug JS and rust?
Does anyone know his vim theme name?)
TTTOOOOOOOOOOOOOOOOOOOOOOKIIIIIIIIIIIOOOOOOOOOOOOOOOOOOOOOOO
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?
Awesome! Still waiting the ELIXIR version of that other server
You PROMISED. gotta keep your promises hehe
Is that elixir comparison still coming 👀
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
I switched to bun, blazingly fast got a ton of weird errors during install/run, returned to node.
switch to rocket
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!
I subbed only because of this dudes presentation style. LOL.
I love go. I started learning it because of your videos. Would love to see a go comparison
go is up next
Blazingly recived SIGSEV ( core dumped )
Blazingly Segfaulted
You said "bake" about bun.
Nice.
you are welcome
I'd like to see more frontend Primeagen in the future, please.
It is time to repeat the test as bun 1.0 is out, isnt it?
Man i love when u scream: blazingly faaaast ❤️❤️❤️ best content as usual! Im becomong addicted to u and theo.gg ❤️❤️❤️
:)
Now Bun 1.0 is releases, could you retry this experiment?
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 was waiting for this video and I was sure that you gonna add that "Blazingly fast" even though they didn't put it
we need a jon_gjengset_pilot plugin for the next rust implementation
I would like to see Deno included in these benchmark. it's blazingly Great to use Deno.
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
mmm mm mmh. I'm seeing big wins in the bun department. Yesir.
But what does happen if you stick that JS into deno?
Lets settle! Thanks for the vid bud :)
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 😅.
I tried but I am not sure what else to do to remove the Mutex's. The root of the issue is that actix uses an app data store to centralize the application data then distributes that among the helper functions that handle each route. The data parameter requires you to implement the 'FromRequest' trait that allows you to get your own data and supply the handler functions but because of the shared state the request data fed to the trait sig is immutable. As the other PR states everything in Actix data wise is wrapped in an ARC since the whole state is shared. Mutex is the only way to share the state and guarantee thread safety. You could break the rules and lazy_static the queue and use a mut ref to the global instance but I think Ferris would put you on a watch list for the rest of your life.
Just a concurrent collection crate. Remember, "&T" means shared, not immutable, and "&mut T" means unique, not mutable (despite the syntax)
prime is the DR disrespect of the dev world :D
I think he would be an actor, something like "my name is Earl"
I'm a dumby, I don't get what the y axis represents.
the amount of items in the queue (they have a 15 second life time).
good call though. should of taken some time here to explain that.