esoterra / component-opt

A Wasm component optimizer (mostly a wrapper around wasm-opt)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Component-Aware Optimizations (Tracking)

esoterra opened this issue · comments

In the future, I'd like this project to expand to offer Component-aware optimization passes.

This issue will act to track proposed optimization passes and be updated in place.

I'm curious if there's an optimization pass we could make to eliminate lifts and lowers when moving between components where they would otherwise be a no-op, e.g. rust to rust string lifting/lowering.

My best guess is that to do that, we would need to

  1. perform component/instance inlining to create a new component using each component's modules and the core adapter module
  2. then perform module/instance inlining to combine the modules together,
  3. then it might be possible for module optimizations to eliminate redundant lift/lower logic in the fused-inlined-adapters.

It's definitely an interesting goal and worthy of a discussion topic and/or issue imo.