ryanpbrewster opened PR #2869 from rpb/fuel-example to main:
This is a quick example of using the "fuel consumption" logic introduced in https://github.com/bytecodealliance/wasmtime/pull/2611/.
It computes larger and larger Fibonacci numbers (using the expensive recursive algorithm) until the computation requires more than 10k fuel.
ryanpbrewster updated PR #2869 from rpb/fuel-example to main.
alexcrichton submitted PR Review.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
Could this be written in either the "naive" form (which should be easier to read) or as a Rust program where the source is more readable? I'm a bit worried that digesting this
*.watfile is a little complicated.
ryanpbrewster updated PR #2869 from rpb/fuel-example to main.
ryanpbrewster submitted PR Review.
ryanpbrewster created PR Review Comment:
I took a stab at re-implementing this using a more natural style. PTAL.
ryanpbrewster updated PR #2869 from rpb/fuel-example to main.
ryanpbrewster updated PR #2869 from rpb/fuel-example to main.
ryanpbrewster updated PR #2869 from rpb/fuel-example to main.
alexcrichton merged PR #2869.
Last updated: Dec 06 2025 at 06:05 UTC