WebAssembly / WebAssembly/binaryen

Stop building with assertions enabled by default?

Open
#3,058 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

Early in Binaryen's history we wanted assertions in all builds in order to catch bugs. It was useful for a while but maybe today it is excessive. Profiling a 200MB wasm file now, I see just isDebugEnabled takes 2.64% of the time. While we could optimize that perhaps, there is surely lots of other overhead from assertions.

Having assertions in our main builds does mean user bug reports are potentially more helpful, but I can't remember them actually helping much? So I'm leaning towards setting BYN_ENABLE_ASSERTIONS to false by default.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the BYN_ENABLE_ASSERTIONS setting and the isDebugEnabled path mentioned in the report. Compare the current default with assertions disabled using a representative WebAssembly input, then weigh the performance impact against the value of assertions in user bug reports. Done means the default-setting decision is resolved and its consequences are validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
build-system, compilers, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.