3 ms·
> 1. avoid floats (fixed point arithmetic saved quite a bit of space) This is really interesting, since WASM has built in float types of course - is there any
by crabmusket 3y ago
> 1. avoid floats (fixed point arithmetic saved quite a bit of space)
This is really interesting, since WASM has built in float types of course - is there any more detail you can go into / examples you can show us?
I have a problem at work where I was thinking fixed point arithmetic might help, because I know my maximum resolution needs (e.g. I know the problem will never care about sub-millimetre positioning). I'd be interested to hear more about related issues.
- dartos 3y agoThey said why right there. Floating point numbers take up more space in memory and can only store smaller values than internet.
- remexre 3y agoAre you sure they're not talking about code size? Not sure what limiting instantiations would have to do with heap size... (I also find it surprising that avoiding floats helps anything; maybe just in avoiding more instantiations? Because if the std floating point functions don't fully inline, you've got bigger problems than wasm blob size...)
- __s 3y agoI'm talking about code size. Wasm has efficient encodings for small integers, but constants for floats always take up 5/9 bytes
- crabmusket 3y agoOh I see! Was this the main benefit, not the use of fixed point algorithms?