I was wondering if it is possible to run parallel for loops in JavaScript using the p5js library?
I am trying to speed up the following code and run multiple points in parallel given each is independent.
<
for (ix = 0; ix < QSS; ix++) {
for (iy = 0; iy < QSS; iy++) {
st1 = 8 * Perlin((ix + xspeed * Tme) / 400 * xs * P2, (iy + yspeed * Tme) / 400 * xs * P2, Tme);
dst1 = Perlin((ix + xspeed * Tme) / 40 * xs * P2, (iy + yspeed * Tme) / 40 * xs * P2, Tme);
nss1 = Perlin((ix + xspeed * Tme) / 100 * xs * P2, (iy + yspeed * Tme) / 100 * xs * P2, st1 + dst1, Tme);
st2 = 8 * Perlin((ix + xspeed * Tme) / 800 * xs * P2, (iy + yspeed * Tme) / 800 * xs * P2, Tme);
}
}
Perlin is a modified version of the p5js noise function. This seems embarrassingly parallel to me and would be easily possible in a different language, I am just wondering if there is any possible way in JavaScript. Many thanks in advance.