Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binary reader to skip function bodies. NFC #1871

Merged
merged 1 commit into from
Mar 23, 2022
Merged

Allow binary reader to skip function bodies. NFC #1871

merged 1 commit into from
Mar 23, 2022

Conversation

sbc100
Copy link
Member

@sbc100 sbc100 commented Mar 22, 2022

This is purely a performance optimization for wasm-objdump since it
doesn't always need to decode function bodies.

For a very large wasm file that I was testing this takes the time taken
for wasm-objdump -h from 8.6s to 1.5s.

@sbc100 sbc100 requested review from dschuff and binji March 22, 2022 21:07
This is purely a performance optimization for wasm-objdump since it
doesn't always need to decode function bodies.

For a very large wasm file that I was testing this takes the time taken
for `wasm-objdump -h` from 8.6s to 1.5s.
@@ -13,12 +12,5 @@ section(CODE) {
}
(;; STDERR ;;;
000001a: error: unexpected opcode: 0xfe 0x7f
000001a: error: unexpected opcode: 0xfe 0x7f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this output duplicated? And, don't we want the same output as we had before, for any behavior that depends on the function contents?

Copy link
Member Author

@sbc100 sbc100 Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the type of the test from run-objdump-gen-wasm to run-gen-wasm-bad. The latter is designed specifically for this type of test where we are testing for a binary parse error.

The error occurs twice in all the run-gen-wasm-bad tests, they all of the duplication like this. I think its because run-gen-wasm-bad runs two different tools under the hood: wasm-validate and wasm2wat, and checks that they both fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, that makes sense.

@sbc100 sbc100 merged commit 27c5d11 into main Mar 23, 2022
@sbc100 sbc100 deleted the skip_bodies branch March 23, 2022 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants