Quote:
Originally Posted by lipidfats
hahaha 99%???
i'm glad i went for the extra gig of RAM a few years ago...
|
How exactly do you expect extra memory to help a purely computational task.
Here is the script simplified:
1. Generate a whole bunch of random numbers
2. Multiply random numbers by resolution to obtain random pixel positions
3. Add the current pixel's y position to a randomly generated fall rate (makes snow go down)
4. Add the current pixel's x position to output of cosine function (makes snow sway)
5. Draw pixels
6. GOTO 3.
The only thing being stored here is the current pixel positions, everything is being calculated several times a second.
Though, why it slows things down probably has more to do with how inefficiently the browser retrieves/modifies html objects rather than the calculations.