Stream: git-wasmtime

Topic: wasmtime / PR #2888 x64: add x64 encoding benchmarks


view this post on Zulip Wasmtime GitHub notifications bot (May 10 2021 at 18:14):

abrown opened PR #2888 from inst-format-4 to main:

This is a follow-up to #2819 to add a benchmark comparing the different encoding approaches (builder vs function) used to encode EVEX instructions. The measurements I observed indicate that the builder pattern is faster, as noted in #2819. The more interesting improvement of this PR is to show how to measure parts of the cranelift-codegen crate. To do so with criterion, I had to make some of the x64 module public:

view this post on Zulip Wasmtime GitHub notifications bot (May 10 2021 at 18:15):

abrown requested cfallin for a review on PR #2888.

view this post on Zulip Wasmtime GitHub notifications bot (May 10 2021 at 18:17):

abrown submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (May 10 2021 at 18:17):

abrown created PR Review Comment:

I think this entire benchmark should be feature-gated (i.e., #[cfg(feature = "x86")]) but I don't know the best way to do this?

view this post on Zulip Wasmtime GitHub notifications bot (May 11 2021 at 17:19):

abrown updated PR #2888 from inst-format-4 to main.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2021 at 16:28):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2021 at 16:28):

cfallin created PR review comment:

You could put the whole implementation inside an inner mod { ... } with the #[cfg(...)], export one main function, and have an alternate (empty) main function with [cfg(not(feature = "x86"))]` probably?

view this post on Zulip Wasmtime GitHub notifications bot (May 12 2021 at 16:28):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2021 at 16:52):

abrown updated PR #2888 from inst-format-4 to main.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2021 at 16:58):

abrown submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2021 at 16:58):

abrown created PR review comment:

Ok, I finally figured out how to do this. My latest update uses the inner module approach feature-gated on x86 and prints a "can't run this benchmark" message if the feature is not present.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2021 at 17:02):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2021 at 17:46):

abrown merged PR #2888.


Last updated: Dec 23 2024 at 12:05 UTC