swiftwasm / swiftwasm/WasmKit

Optimize parsing + translation time

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
504
Forks
37
Avg merge
1d 1h
Merged PRs (30d)
44

Description

Launch_swift-plugin-server_2024-10-14_13.32.19_2F702FD8.trace.zip

Parser

  • Optimize parseInteger
  • Use mmap
    • Consider madvise(MADV_DONTNEED) not to page-in whole .wasm contents

Translator

  • Reuse internal Array buffers across translation to avoid allocation a fresh Arrays for each translation
    • removeAll(keepingCapacity: true)

Contributor guide

No contributing guide indexed for this repository

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 with the attached launch trace and locate the parser's parseInteger path, the mmap-related loading code, and the translator's internal Array allocations. Compare parsing and translation time and memory behavior before and after reusing buffers with removeAll(keepingCapacity: true); done means measurable improvement without changing translation results.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.