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
feat: enable wasm optimizations using binaryen #433
Conversation
Let's start with #434. That only reduces the bundle size and doesn't optimize the actors, but it's a good start. |
I think running the optimized code with dual execution in a debug bundle (assuming we can get gas/time reports from both) to check on performance improvements and get more confidence for correctness would be an excellent thing to do post M1 launch. |
This enables both the speed (3) and size (z) optimizations, bringing the miner actor down to 1MiB.
@Stebalien what's the status here? Do we still want to do this? |
Yes we probably still want it. At a minimum, it reduces binary size a bit. It may also make things faster (actually, I'm pretty sure it does by optimizing some bulk memory operations), but we haven't merged it because we haven't benchmarked that yet. Ideally we'd be able to use our conformance test benchmarks, but those don't give us accurate numbers at the moment. |
we should run some gas benchmarks, this is very desirable. |
@Kubuxu did your benchmark show any benefit? |
In my benchmark it saves 0.8%. |
Ah, I see. I'd still like this change for the _size_ optimizations, but it's significantly less pressing.
At least it doesn't slow things down or anything.
|
Yeah, I've done some more benchmarking, and this mostly just makes the build really slow. |
This enables both the speed (3) and size (z) optimizations, bringing the miner actor down to 1MiB.
Draft because, while this PR is correct, there's a bug in the FVM filecoin-project/ref-fvm#602.This PR has two main parts:
Motivation:
In terms of how much this helps.... we'll need more thorough testing, but it looks like it helps a bit...
The main downside of this change is that it would:
I'm happy to drop the binaryen part if we feel that it's too risky, too late. But I'd like to drop the debug info from the release builds so we can get the bundle size down. This would let us check-in the main bundles into the lotus source, significantly simplifying the build process.