Comment

Comment by C4stor

All of this seems unnecessary, and easily replaced in the provided benchmark by :

i2 = np.ascontiguousarray(pg.surfarray.pixels3d(isurf))

Which does the 100x speedup too and is a "safe" way to adjust memory access to numpy strides.

Whether the output is correct or not is left as an exercise to the author, since the provided benchmark only use np.zeros() it's kind of hard to verify

parent C4stor 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton