how fast is javascript simulating 20 000 000 particles
The challenge, simulate 1,000,000 particles in plain javascript at 60 fps on a phone using only the cpu. Let’s go. Ok, this is not a particularly difficult challenge if you did all the work on a gpu but the rule of the challenge is to use the CPU only or as much as possible and to stay in js land so no wasm. I know what you are thinking. This isn’t too hard. Just create an array and stick a million objects in it. Something like this maybe? Then you would just loop over your particles with something like this And assuming this is on a browser just toss that in a request animation frame with a canvas for rendering Now, this may be enough if you have a single fast cpu but mobile devices are not known for their single core performance. They have many small power efficient cores. And to hit the target, one million particles, I need to get as they say What is the fastest, most stablest, and predictable way of doing lots and lots of computations in any programming language? Tightly packed con
How fast is javascript? Simulating 20,000,000 particles Home / blog How fast is javascript? Simulating 20,000,000 particles The challenge, simulate 1,000,000 particles in plain javascript at 60 fps on a phone using only the cpu. Let's go. Ok, this is not a particularly difficult challenge if you did all the work on a gpu but the rule of the challenge is to use the CPU only or as much as possible and to stay in js land so no wasm. I know what you are thinking. This isn't too hard. Just create an array and stick a million objects in it. Something like this maybe? const count = 1 _000_000; const
related reading
- Thousands of Styled Rectangles in 120FPS on GPU - tchayen.comtchayen.com
- The Web Animation Performance Tier List | Motion Magazinemotion.dev
- Speeding Up the Webcola Graph Viz Library with Rust + WebAssembly - Casey Primozic's Homepagecprimozic.net
- Let’s Handle 1 Million Requests per Second, It’s Scarier Than You Think!youtube.com
- The Web Animation Performance Tier List | Motion Magazinemotion.dev
- Teaching GPU programming in p5.js: now with compute shaders - Dave Pagurekdavepagurek.com
- Behind The Scenes of Bun Install | Bun Blogbun.com
- Production Twitter on One Machine? 100Gbps NICs and NVMe are fast - Tristan Humethume.ca
- Populating the page: how browsers work - Performance | MDNdeveloper.mozilla.org
- diffuse.onediffuse.one
- 7 Principles of Rich Web Applicationsrauchg.com
- Shading Motion - The Blog of Maxime Heckelblog-git-motion-post-maxime-heckels-projects.vercel.app