perlin-network / life

A secure WebAssembly VM catered for decentralized applications.
MIT License
1.7k stars 122 forks source link

panic: input too large #81

Closed jtremback closed 5 years ago

jtremback commented 5 years ago

I'm trying to run stuff from the benchmarks folder just to get a sense of how things work.

In the fib_recursive benchmark folder I ran cargo build --release. This produced a .wasm file in the target folder. I then tried to run it with life like this:

$ ./life bench/cases/fib_recursive/target/wasm32-unknown-unknown/release/fib_recursive.wasm 
panic: input too large

goroutine 1 [running]:
main.main()
        /Users/jehan/life/main.go:86 +0xc29
jtremback commented 5 years ago

For some reason, cargo is building a huge binary:

$ du -sh bench/cases/fib_recursive/target/wasm32-unknown-unknown/release/fib_recursive.wasm 
1.4M    bench/cases/fib_recursive/target/wasm32-unknown-unknown/release/fib_recursive.wasm

This is likely not an issue with life.

jtremback commented 5 years ago

Adding

[profile.release]
lto = true

to the cargo.toml has reduced the size to 48k, which life can run.