Hacker News new | ask | show | jobs
by flohofwoe 155 days ago
FWIW the native and WASM versions of my home computer emulators are within about 5% of each other (on an ARM Mac), e.g. more or less 'measuring noise':

https://floooh.github.io/tiny8bit/

You can squeeze out a bit more by building with -march=native, but then there's no reason that a WASM engine couldn't do the same.

1 comments

SIMD and multithreading support really helped with closing the performance gap.

Still surprised about the 5% though- I’ve generally seen quite a bit more of a gap.

Maybe the emulator code is particularly WASM friendly ... it's mostly bit twiddling on 64-bit integers with very little regular integer math (except incrementing counters) and relatively few memory load/stores.