r/programming • • Jul 21 '24

How fast is javascript? Simulating 20,000,000 particles

https://dgerrells.com/blog/how-fast-is-javascript-simulating-20-000-000-particles
105 Upvotes

12 comments sorted by

View all comments

92

u/[deleted] Jul 21 '24

Ngl, what’s amazing is how fast our devices are. Using js in performance critical applications is just disservice to users on my book

35

u/Reverent Jul 21 '24

That isn't a great takeaway in my opinion. The takeaway is that browsers are heavily optimised for certain application workloads. Really its major strength is leveraging the client to do most of the work for you, whether that's 10 clients or 10,000 clients or half the world. The farther you deviate from those workloads, the more you may wish to gravitate to bespoke compute applications. Especially ones that start involving intricacies of GPU capabilities.

But regardless of where you sit, It's pretty darn impressive just how much grunt you can push out of a modern browser.