Dramatically faster on the Macbook M1 Max

I was actually a little surprised when I loaded this simple three.js demo on my shiny new Macbook Pro M1 Max and it was ridiculously faster than on my Macbook Pro 2019. I mean, a frame-per-second is a frame-per-second, regardless of hardware. Is the animation/rendering on my 2019 that much below-speed, or is it that much over-speed on my M1 Max? Is there something I can change to ensure that the demo runs at the same speed regardless of machine?

I forked the example to add stats.

What’s your frame rate in each case? If it’s running very low on the older computer maybe the physics is not accounting for that correctly.

over-speed on my M1 Max?

I tested and can hit 260fps with the max number of balls on my laptop so I don’t think it’s overspeed issue.

1 Like

I noticed that on my MacBook 2019 I had to f-with the Canon.js gravity in order for the ball objects to bounce somewhat close to like they would in reality. At the time, I chalked it up to just not having a deep understanding of Three.js, Canon.js, or WebGL yet. Maybe it’s just that normal mortal computers just can’t keep up, and this maxed out M1 Max with a 32-core GPU isn’t even breaking a sweat.

Yeah, when I set the Canon.js gravity to -9.8 (which is apparently equal to 1G), it looks realistic on the M1 Max.

You can make any computer break a sweat by disabling the browser FPS limiter btw.

Run Chrome with these flags and it will run the scene at maximum frame rate on whatever machine until it’s limited by either the CPU or GPU.

chrome --disable-gpu-vsync --disable-frame-rate-limit

1 Like

Is there a solution to make m1 macs run at a normal speed?

@HoraceShmorace just in case, cannon hasn’t been maintained for 7-8 years, better use GitHub - pmndrs/cannon-es: 💣 A lightweight 3D physics engine written in JavaScript. which is maintained. wouldn’t be the first time that issues just go away. though in this instance, the mbp 2019 is the slowest laptop i have ever owned. it was fine in the beginning, then it clogged up until it practically only opted for heavily throttled integrated gfx. you don’t have to worry about it, the few that are still around are about to give out or go up in flames.

1 Like

Is there a way in code to make threejs expereinces run at a normal rate on m1 macs?

It depends.
Can you provide some coding?