|
|
|
|
|
by seanwilson
2682 days ago
|
|
Maybe this is what you meant but the snippet can be optimised a ton as well unless I'm missing something: - Move the "y * width" calculation outside of the "for x" loop. - The multiply operators can be replaced with addition e.g. replace "y * width" with "counter += width" each y iteration and similarly for the x loop. Optimising inner loops is really fun. How much of the speed up in the article is because the JS engine can't figure out how to optimise it compared to the WebAssembly compiler? |
|