News for hackers. Stuff that matters.
Re:Optimizing the Particle Life: From 400 to 4M particles by bscottmay on Monday March 18, 2024 @02:29PM (#39748080)
Yeah, an all-numpy version runs in less than 1ms on my M1 air

  import numpy as np
  l = 10_000
  t = np.empty(l, dtype=np.float32)
  j = np.arange(l)
  t = 0.02 \* j
  t *= (0.03 * j)
  t -= (0.04 \* j)
  t /= 0.05 \* (j + 1)
Re:Optimizing the Particle Life: From 400 to 4M particles by Twirrim on Monday March 18, 2024 @04:26PM (#39749576)
So rather than spend 10-20 minutes reading about numpy, the author wrote 3 other implementations...?

The fact that they ran the C code without the optimisation flags and compared it that way makes me think Javascript was what they actually wanted to write this one in anyway.

Re:Optimizing the Particle Life: From 400 to 4M particles by Etheryte on Monday March 18, 2024 @08:06PM (#39751556)
The author, by the looks of it from the article, is a uni student. Rather than straw-manning this into a language war, we should laude the fact that they managed to write the same thing in a number of different languages to begin with.