What deep magic is this? Or have I made a terrible mistake?
My first ever Rust program, after a few days studying Rust, finds anagrams in the 650,000 words of the Debian dictionary file /usr/share/dict/british-english-insane.
I have a build script that builds a regular release executable and also builds as WASM and binds for node.js and the browser.
You can see it run in the browser here: http://otaniemi.conveqs.fi:9000/www/
Code is here: https://github.com/ZiCog/insane-british-anagram-rust
Now, I would not normally mention any of this except for one thing...
How come the WASM build under node.js can be 40% faster than the native x86-64 build?
$ ./target/release/insane-british-anagram > anagrams.txt 503ms 473ms $ cd nodejs/ $ node index.js > anagrams.txt 597ms 288ms
How come in the web page in Chrome it runs in 403ms. Faster than native executable.
The execution times measured there do not include the time to read the dictionary file or print the output. I have made release builds all round.
Am I going nuts?