WebAssembly / WebAssembly/binaryen

Read-only memory optimizations

Open
#3,263 13 comments 2 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

This came up in the context of thinking about how to optimize file system calls, but it could be more generally useful. The idea is to tell Binaryen what memory is read-only, essentially telling it where the .rodata section is. Then optimizations like precompute and constant propagation would be able to resolve loads from that memory at compile time. This could particularly help for precomputing string operations like strlen and strcmp when their arguments are constant strings.

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 reading the issue proposal and its references to Binaryen optimizations such as precompute and constant propagation. No files, tests, or entry points are named, so first determine where memory information and these optimizations are represented. Done would require an agreed design and support for resolving loads from declared read-only memory, including the cited constant-string cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
compilers, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.