Stream: git-wasmtime

Topic: wasmtime / issue #10287 Performance issue during `Drop` o...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 24 2025 at 21:49):

jaybarbhaiya added the bug label to Issue #10287.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 24 2025 at 21:49):

jaybarbhaiya opened issue #10287:

Thanks for filing a bug report! Please fill out the TODOs below.

Note: if you want to report a security issue, please read our security policy!

Test Case

Wasm file

Steps to Reproduce

git clone https://github.com/jaybarbhaiya/wasmtime-module-drop-test.git
cargo bench

Expected Results

The time taken to drop a wasmtime::Module should be comparable across different operating systems.

Actual Results

The drop of a wasmtime::Module in MacOS is significantly higher than that of Linux and Windows.

Versions and Environment

Wasmtime version or commit: 30.0.1

Operating system: MacOS 15.3.1

Architecture: arm64

Extra Info

1000 wasmtime::Module are created with the wasm binary attached above and then dropped. GitHub actions are set up in the repo, which runs the cargo bench command in ubuntu-latest, windows-latest, and macos-latest runners. The screenshot below shows the results:

ubuntu-latest
![Image](https://github.com/user-attachments/assets/4fa2734d-0fbf-464e-b23c-434a59d53133)

windows-latest
![Image](https://github.com/user-attachments/assets/1787f67b-54a9-4fc9-8440-48a60f4dbd57)

macos-latest
![Image](https://github.com/user-attachments/assets/2a14bd20-b98a-4c45-a6de-3cd6ec332537)

The difference that was observed, in MacOS, the wasmtime::CodeMemory drop takes a significant amount of time which is not the case in Linux. It would be valuable to get some insights.

Thank you.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 24 2025 at 21:56):

alexcrichton commented on issue #10287:

Thanks for the report! This is likely the cause of Config::native_unwind_info being default-on. OSes have widely varying implementations of how information is unregistered, and IIRC I've also seen macOS be significantly slower than other platforms.

If that option is disabled, though, does it improve the performance you're seeing?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 25 2025 at 07:51):

jaybarbhaiya closed issue #10287:

Thanks for filing a bug report! Please fill out the TODOs below.

Note: if you want to report a security issue, please read our security policy!

Test Case

Wasm file

Steps to Reproduce

git clone https://github.com/jaybarbhaiya/wasmtime-module-drop-test.git
cargo bench

Expected Results

The time taken to drop a wasmtime::Module should be comparable across different operating systems.

Actual Results

The drop of a wasmtime::Module in MacOS is significantly higher than that of Linux and Windows.

Versions and Environment

Wasmtime version or commit: 30.0.1

Operating system: MacOS 15.3.1

Architecture: arm64

Extra Info

1000 wasmtime::Module are created with the wasm binary attached above and then dropped. GitHub actions are set up in the repo, which runs the cargo bench command in ubuntu-latest, windows-latest, and macos-latest runners. The screenshot below shows the results:

ubuntu-latest
![Image](https://github.com/user-attachments/assets/4fa2734d-0fbf-464e-b23c-434a59d53133)

windows-latest
![Image](https://github.com/user-attachments/assets/1787f67b-54a9-4fc9-8440-48a60f4dbd57)

macos-latest
![Image](https://github.com/user-attachments/assets/2a14bd20-b98a-4c45-a6de-3cd6ec332537)

The difference that was observed, in MacOS, the wasmtime::CodeMemory drop takes a significant amount of time which is not the case in Linux. It would be valuable to get some insights.

Thank you.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 25 2025 at 07:51):

jaybarbhaiya commented on issue #10287:

Hi @alexcrichton
Thank you for the quick response!
Disabling Config::native_unwind_info improved performance. Please see below the updated benchmark from the macOS GitHub runner.

<img width="578" alt="Image" src="https://github.com/user-attachments/assets/4b501ade-bb9e-4d70-8bf2-63b6b14e6ca9" />

Thank you again for the clarification :blush:


Last updated: Feb 28 2025 at 01:30 UTC