Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asm.js support #5

Closed
deathcap opened this issue Jan 2, 2014 · 1 comment
Closed

asm.js support #5

deathcap opened this issue Jan 2, 2014 · 1 comment
Labels

Comments

@deathcap
Copy link
Contributor

deathcap commented Jan 2, 2014

Any interest in porting this module to use asm.js for potentially better performance? Seems like a good fit (pure math).

I've started to.. my progress is available at https://github.com/deathcap/simplex-noise.js/tree/asm - only for noise2D at the moment, produces identical output as the original implementation (unit tests added) + successfully links as asm.js in Firefox.

Unfortunately, benchmarks show the asm.js version is drastically slower: http://jsperf.com/simplex-noise-comparison-asm (haven't yet tracked down why, exactly; very new to asm).

@jwagner
Copy link
Owner

jwagner commented Jan 11, 2014

Any interest in porting this module to use asm.js for potentially better performance? Seems like a good fit (pure math).

In my opinion asm.js is mostly interesting as a target for compilers. It's a pita for us humans. Also I'm not sure if calling asm.js code from non asm.js code has an additional overhead and/or won't be inlined properly. If it was significantly faster in the real world, it would be interesting. But for now I'm really not convinced.

(haven't yet tracked down why, exactly; very new to asm).

It could be that there actually is a boundary.

In any case it is a very interesting experiment. Keep me up to date if you find out something new. :)

@jwagner jwagner closed this as completed Mar 17, 2014
deathcap added a commit to voxel/voxel-land that referenced this issue Jul 12, 2014
asm.js currently has a massive performance hit when crossing the
asm.js/JavaScript boundary, which happens on every simplex noise call,
so it is noticeably slower than pure JavaScript for chunk generation.
Revert to the 2.1.1 simplex-noise release (without asm.js) to fix this.

jwagner/simplex-noise.js#5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants