Stream: git-wasmtime

Topic: wasmtime / PR #4538 Don't allocate in DataFlowGraph::bloc...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2022 at 01:18):

jameysharp requested cfallin for a review on PR #4538.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2022 at 01:18):

jameysharp opened PR #4538 from no-small-vecs to main:

DHAT reports that when compiling the Spidermonkey Sightglass benchmark,
there are over 100k of these Vec allocations, averaging less than 4
bytes, and with an average lifetime of only about 500 instructions.

This function is only called from one place, which immediately converts
it into an iterator. So this commit just returns the iterator that was
previously being collected into a Vec. The iterator has to borrow from
the DataFlowGraph, so this would change borrow-check results, but in the
one caller that turns out to be okay.

(That sole caller is in cranelift/codegen/src/machinst/lower.rs, in
Lower::lower().)

According to Sightglass, this is a compile-time improvement of between
2% and 12% on the Spidermonkey benchmark:

instantiation :: nanoseconds :: benchmarks/spidermonkey/benchmark.wasm

Δ = 14628.76 ± 10318.59 (confidence = 99%)

main-0e6ffd024.so is 0.87x to 0.98x faster than no-small-vecs.so!
no-small-vecs.so is 1.02x to 1.14x faster than main-0e6ffd024.so!

[142023 187464.24 301522] main-0e6ffd024.so
[103742 172835.48 263917] no-small-vecs.so

compilation :: nanoseconds :: benchmarks/spidermonkey/benchmark.wasm

Δ = 362392705.93 ± 267070467.06 (confidence = 99%)

main-0e6ffd024.so is 0.89x to 0.98x faster than no-small-vecs.so!
no-small-vecs.so is 1.02x to 1.12x faster than main-0e6ffd024.so!

[3655734131 5522594697.83 6471126699] main-0e6ffd024.so
[3278129811 5160201991.90 5810600015] no-small-vecs.so

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2022 at 01:18):

jameysharp requested fitzgen for a review on PR #4538.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2022 at 01:22):

jameysharp updated PR #4538 from no-small-vecs to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2022 at 01:42):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2022 at 01:43):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2022 at 01:47):

jameysharp has enabled auto merge for PR #4538.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2022 at 01:59):

jameysharp merged PR #4538.


Last updated: Nov 22 2024 at 17:03 UTC