Skip to content

Miscellaneous tweaks to speed up call/RPS benchmarks#7953

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
fitzgen:misc-call-speedups
Feb 17, 2024
Merged

Miscellaneous tweaks to speed up call/RPS benchmarks#7953
alexcrichton merged 1 commit intobytecodealliance:mainfrom
fitzgen:misc-call-speedups

Conversation

@fitzgen
Copy link
Copy Markdown
Member

@fitzgen fitzgen commented Feb 16, 2024

This commit makes the following changes:

  • A handful of #[inline] annotations.

  • A couple cases of splitting out uncommon/slow paths from #[inline]-annotated functions into their own non-#[inline]-annotated functions.

  • Remove a call to mpk::is_supported() in async context construction. It is sufficient to just check self.pkey.is_some() since if mpk isn't supported we won't have a pkey, if we do have a pkey mpk must have been supported for us to get it, and even if mpk is supported, if we don't have a pkey we don't need to do anything here.

Criterion benchmark results:

sync/no-hook/core - host-to-wasm - typed - nop-params-and-results
                        time:   [25.214 ns 25.322 ns 25.443 ns]
                        change: [-21.901% -20.227% -18.749%] (p = 0.00 < 0.05)
                        Performance has improved.

This commit makes the following changes:

* A handful of `#[inline]` annotations.

* A couple cases of splitting out uncommon/slow paths from `#[inline]`-annotated
  functions into their own non-`#[inline]`-annotated functions.

* Remove a call to `mpk::is_supported()` in async context construction. It is
  sufficient to just check `self.pkey.is_some()` since if mpk isn't supported we
  won't have a pkey, if we do have a pkey mpk must have been supported for us to
  get it, and even if mpk is supported, if we don't have a pkey we
  don't need to do anything here.

Criterion benchmark results:

```
sync/no-hook/core - host-to-wasm - typed - nop-params-and-results
                        time:   [25.214 ns 25.322 ns 25.443 ns]
                        change: [-21.901% -20.227% -18.749%] (p = 0.00 < 0.05)
                        Performance has improved.
```
@fitzgen fitzgen requested a review from a team as a code owner February 16, 2024 23:18
@fitzgen fitzgen requested review from pchickey and removed request for a team February 16, 2024 23:18
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Feb 16, 2024
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @peterhuene

Details This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton alexcrichton added this pull request to the merge queue Feb 16, 2024
Merged via the queue into bytecodealliance:main with commit e257036 Feb 17, 2024
@fitzgen fitzgen deleted the misc-call-speedups branch February 17, 2024 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants