How to make TypeScript Blazingly Fast (JavaScript/NodeJS)
ฝัง
- เผยแพร่เมื่อ 24 ก.พ. 2022
- I have been doing some performance stuff at Netflix for some time. I wanted to take some time to share with you two very specific techniques for making your applications faster.
One of the two steps is surprisingly beneficial.
HERE IS HOW TO RUN THE PERF COMMANDS:
GO TO THIS LINK: github.com/ThePrimeagen/tyron...
Links
Linode: linode.com/prime
Discord: / discord
Twitch: / theprimeagen
Insta: / theprimeagen
Twitter: / theprimeagen
VimRC & i3: github.com/ThePrimeagen/.dotf...
Keyboard (15% off, I don't earn commission): bit.ly/primeagen-adv2
#vim #nodejs #javascript - วิทยาศาสตร์และเทคโนโลยี
I hope you liked this video (literally, press the damn button already). If you like comparison videos / perf videos LET ME KNOW. TELL ME AND I'LL KEEP MAKING THINGS!!! Else I'll quit and make a vlog about my new protein drink line. ITS NOT A PYRAMID SCHEME... its a triangle.
Yes keep going
Love that contenttt , please do rust
I like it
Oh shit I forgot to add pooling to the database connection in my hobby project!
Performance videos are the best!
This is becoming one of my favourite programming TH-cam channels... Blazingly fast!
Most excellent!
@@ThePrimeagen I think you're my favourite programming channel now too. Only downside is you make me feel like dogshit when you roll out optimisation like this beast! 😁
Amazingly good combo of tempo, humour and insightful knowledge. Been professionally developing for about 15 years. Loved this video big time!
Awesome! My goal is to make non slow tech videos :)
@@ThePrimeagen that feels like an untapped market on TH-cam. Excited to see you pushing more of these out over time!
@@ThePrimeagen You could say your tech videos are... BLAZINGLY FAST
I really liked the graphs being included. Also i learned about flame graphs!
Yeah. FlameGraphs are SUPER useful.
Agreed, I’ll for sure be using flame graphs in the future
Oh Sheets, this guy is a data wizard
🧙♂
Prime is coming to steal jobs from data scientists LUL
@@adgai prime?
clicked the vid blazingly fast
And like the vid blazingly fast
Karen!!
watched the vid blazingly fast at 2x the speed of normie watchers who watch at 1x!!!!
Love the content! Your DSA course on Frontend Masters is one of the best contents I have ever watched. It really lives up to the expectation. Nothing has got me nearly excited about DSA as much as that course. Thank you very much. Love from Ghana! :)
Dude, that was a BLAZINGLY good video.
I love how you add some humor to this technical content.
By the way, the content was excellent by itself. It's good to know the tools you use to analyze the performance and how you optimized the code!
I love optimization videos and it's really cool to see your process and tools to solve a slow implementation problem. Keep them videos coming!
I LOVE seeing these perf videos, just subbed :D
Keep them coming!
LOVE THIS! Awesome video, I loved how you went over the ring buffer, always nice to see some cs theory in the mix
The Primeagen: Bringing the science back to computer science since 1969
th-cam.com/video/cbCu9sUzcXg/w-d-xo.html
just strted a bootcamp 3months ago and had some prev exp so i can understand maybe 15% of your content but nonetheless im learning a new little fragment of concept in every video that hopefully i will be able to master later..your energy is an inspiration...lets all screaaam moreeeee goddaaaaamn
YAYAYAYAYAYA! Keep your chin up, you got this babe!
Great video man. I really enjoy your content and always wait for a new video. Optimisations and comparisons are always interesting to watch. Keep up the good work.
awesome! Hopefully you feel like you had a couple of action items to take away if you ever work in node.
The great thing about your videos is that the things you show can be applied anywhere with any language which is awesome.
Also because you are ThePrimeagen I have to mention… I started using Neovim because of you. I wish I get as comfortable as you are someday.
Love the video! The mix of informative and funny is well balanced and I learned something out of it.
awesome! Did memory part surprise you?
I like the eloquence of your videos, I appreciate you, you give me inspiration to make better code Blazingly fast!
BLAZINGLY FAST!
Thank you for the nice words.
I’m in love with this channel, it’s amazing. Wish there were even more videos.
Trying! Its hard to make good videos :)
Great content! Somehow I really like JS things, and these kind of content is awesome. This is becoming my fav tech channel
It has become rare, that YT videos really make me lol, but man, you definitely still got the power to make me giggle. Top notch blazingly fast sub!
I like your style. Great content. Thanks for putting it out on here and keep it up 🙏
thanks for covering the flame graph stuff. that was really interesting to learn about
This is such a great video! Got introduced to this channel at work!
great! I am happy you like this.
Great video prime! Keep it up, love the graphs
good. I do too :)
Thumbs up 👍
I sadly missed this stream, caught the tail end of it as you were building the graphs. This content is amazingly blazingly fastacular. I got a little randy when you described the use case for the memory pool and then saw the improvements with it… best programming content on the web for people who actually have to build stuff.
Hah! Now it's a bit dangerous doing pools. They are hard to use properly
@@ThePrimeagen But what if it's a pool of coconut oil?
This was refreshing, the information been shared in this channel is on point!
Yayayayaya! Ty. Just trying to cut through the yt bs
Entertaining, fun and full of new techniques to learn! *_BLAZINGLY FAST_* channel!!!!
There's more science in this video than 90% of the academic papers that I had to read in my academic career, congrats man :)
Awesome content as always.
There is a lot to learn from the way you approach optimization (I mean who doesn't want a bigger blue bar?), as without numbers you are just blind in the mist.
Flame graphs are awesome!
yayaya! Always start with a proper yard stick.
I liked this video very much and I learned a lot. Keep up the good work! ❤💪
Thank you
Big ups for sharing/exposing us viewers to this visualization tool for identifying performance bottlenecks….so clutch!
This blew my mind. Time to start monitoring the performance of my node server
awesome! I thought the memory stuff was really surprising for me.
man that was really informative video
♥♥♥
you are welcome :)
Such an interesting video, love the heavy use of data to prove your changes actually made a difference. Would love to see this kind of stuff compared with Rust and it’s non-garbage collected memory management.
Love seeing those graphs 😍😍😍
Absolutely loved this video. Thank you.
You are welcome
Awesome!!!!, I really enjoy watching this!!!!!
Ahyo, just discovered this channel and I'm VERY interested in this optimization stuff, specifically for TS, but also with regards to the "how do you actually measure stuff". Explaining perf some more would be amazing. I cant really join twitch because of timezones, but if some of that made it to your yt-channel, I would be very happy!
I just can’t believe how you manage this! Eng gig at Netflix, an ever increasing family size, what, is it now, 5 or 6 kids(?), live streams on twitch and then these buttery smooth, MCT oil’y goodness on the TH-cams! Keep up the great work!
It's the mcts baebee
@@ThePrimeagen hmmmm....it's always the MCTs!!!!
I would be interested in more in-depth js optimization videos, nice job!
The amount of effort put in optimizing this youtube content is over 9000
I am amazed. Incredible content!
you are welcome!
I am glad you liked it.
Great videos man
need this TYRONE content streamed directly into my brain
get ws, a blazingly fast library.
Amazing content as always! I would like to see this comparisons vs unoptimized Go server
yeah. That is literally next.
Rewatching this after SOLIDjs dev hour is even more satisfying. Thanks for reminding
We LOVE tthese blazingly fast videos ♥️
Awesome. I hope you enjoyed this.
Unbeatable content, congrats!
How long did it take you to get this done? How did you measure the avg health of your loops and generated those charts?
To make the example took ~30-40 hours of programming
To collect that data took about 10 hours of different experiments
To measure the health: github.com/ThePrimeagen/tyrone-biggums/blob/master/typescript/src/game_loop/game-callback.ts#L22
That collects the stats then whoever is the winner of the stats will send down how many currently active games were being played + the 8 points of data representing the count in each bin. Used a simple script to post process all the data transfered.
nice video prime!! Love to see this in rust.
This is amazing stuff I can watch this all day
Multi-threaded JS, native add ons, data driven eng initiatives. These 👌
This is great content!
Currently my code is mostly slowed down by the slow rendering engine, so I was on a mission to simplify the HTML. Removing layers of containers (DIVs), replacing some with simple padding/margin.
Probably going to look at object creation next.
had seen this video around 6 month's before, did'nt understand shit. It was recommended again in my feed today, and i tottally understand everytying. feel's so damn good!
Would love to see similar benchmarks and profiling in Go 🙏
I am going to try to do some great go content.
That is next. Next will be a rust vs go.
It was nice seeing development tools you use to analyze your code. I have never entered the memory tab before in dev tools and also cant seem to get the same view as you do. Did you do something else for that? I am using chrome. Thanks. Love your content.
yeah. You need to make sure you select the 3rd option, the bottom one, and record the heap sampler. Then you may need to select the view (i think it defaults to tree when it should be chart)
never seen flamegraphs but they seem to be a nice thing! thanks for showing those to us
I like these kind of videos. Please make them more.
Boy oh boi! that was Blazingly FAST!
🏃♂️⚡️⚡️
thank you marcos :) See you on twitch.
Good job!
I personally would like to see a similar comparison with Go.
its already on its way.
I liked that I got to know how to improve performance of typescript programs. I would also like to know about a complete suite of tools, where database calls from typescript can also be viewed on a graph.
Yeah, more is awesome. A lot of these tools you speak of are pay to play
Amazing video!
I would like to invite Prime to make a lecture for my students... problem - we use VSC 😬😅❤🤗 still - I love Primeagen 🎅
hahah! that is ok. Students have to start somewhere.
Vscode is the only way, vim is for pure savages
I love this kind of content
Can’t wait for the Rust vs go comparison
same! Almost done with the go server.
Great video. Loved how you told the story of the whole optimization process illustrated with your graphs. Showing us how to apply these tools along the way. And getting great results by applying some good fundamentals in algorithms and memory management.
While I do like the overall tempo of the video, I find that getting too many shortly spaced cuts in your speech when you're explaining something more complicated can be a bit jarring and interfere with fully comprehending the content.
Solid feedback. I'll consider that moving forward.
@@ThePrimeagen I think this is a personal preference. I like the cuts, makes it more compact and keep my attention.
Great content, thank you!! I would love to see the results of go and rust...
I would really like to see some more in-detail optimization tutorials about tools and how to use them for JavaScript/TypeScript. 😊
I really like your js content
really like the case study, really easy to follow. I would really like to see some C++ experiment from you, maybe in comparison with Rust?
I'll be doing go vs rust. c++ is just soooooo much effort. I'll spend like 15 hours just getting the proper build system
@@ThePrimeagen Yeah, I completely understand the problem with C++ for these "side-experiments". Go vs Rust sounds awesome!
Wow! Not gonna lie the memory pool stuff felt over my head a bit but hey, this is good stuff Prime. More comparison/perf stuff plz.
JSJOEIO!!! What??!!! Memory pools are the bestest!
@@ThePrimeagen lol guess i've never had a reason to use em'??? but with those performance gains, might be worth learning
i liked the video. really awesome 🙌
you are welcome.
great content as always, if you can suggest a resource to learn more about optimization that would be Blazingly Helpful !
I've never turned a notification bell on before =O
Super insightful. Heading on to twitch now. Also, I hope this comment helps you plot those sweet perf improvement graphs.
Ty, and they do
12 minutes? That is not blazingly fast at all
Just finished the video, and it was really interesting! Great job
I do love you, don't mind my twitter presence... he is a jerk.
that's amazing man
Wtf I loved this… subscribed.
This is great 😍
Awesome. Thank you grim
Does the primagen edit his own videos? Cause the editing is sharp and hilarious
I’m the editor:) Thank you I appreciate that!
@@flipmedia1597 Right on! The editing is hilarious! Great stuff 🙏
@@flipmedia1597 The editing is next level. It's as tight as hand-written assembler code.
This was very cool.
Loved it.
Awesome! I am happy here :)
how did you solve that so.... BLAZINGLY FAST xD
But srsly, really good content, cant wait for the Rust VS Go video
Yyayayayayayaytaa
This is now my fav programming channel
Also everything for some reason became blazingly fast
Even my anxiety
Help
this happens to us all
amazing content, thank you.
This is gold content. I love it!
I Usually do not comment, but I wanted to help you satisfy your graphs fetish.
ty ty ty! Its very fetishy too
This is cool!
I agree!
awesome video!
ty
This is like really really really interesting, i want your knowledge
Wow!! That's blazing fast 😮
Such Fast
Much wow
I saw those flame graphs when profiling my app, but didnt really know how to read em 😂 Happy i do now
I WANT MORE OF THE PRIMEAGEN!!!!!
I AM TRYING
Just letting you know: I like this content
THank you :)
Just a comment to increase the comment amount graph. Your content is golden!
Ya ya, ty
Awesome video, you got +1
Awesome. Thank you!
I like perf videos, especially comparison.
looking forward to the RxJS part
we will see :)
I love graph.
I really love all videos. :D
I would like a video that you installed your dotfiles from zero or a video about arch linux (is that your OS?)
If I miss some english grammar, hope you can forgive me blazingly fast
i definitely do not use arch. I have kids which has been disallowed by the international linux committee to use Arch Linux.
More of this please.
me likes it, me likes it a lot. Please do a Go and Rust comparisons!!! Now putting myself into await pool for that
yayayayayayaya! Just don't forget to bring your Tokio Mutex if you are awaiting into the pool.
A 1 sec improvement in js in comparison to itself is really a blazingly fast improvement 😂
it really is!!! hah
I need to implement this in to my work flow
its good once you are done with the project to go back through and make it better
excellent content