Skip to content

perf: cranelift-srcgen: optimize Formatter buffering - #14094

Open
dishmaker wants to merge 1 commit into
bytecodealliance:mainfrom
dishmaker:dishmaker/perf_cc_formatter_buf
Open

perf: cranelift-srcgen: optimize Formatter buffering#14094
dishmaker wants to merge 1 commit into
bytecodealliance:mainfrom
dishmaker:dishmaker/perf_cc_formatter_buf

Conversation

@dishmaker

@dishmaker dishmaker commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

This reduces run-time of cranelift-codegen (build-script) (run):

  • -0.4% on debug
  • -3.1% on release 1

by changing:

  • lines: Vec<String> to
  • lines: String

so that

file.write_all(self.lines.as_bytes())?;

is called once.

Depends on #14092

Footnotes

  1. build script won't be in opt-release mode, because of [profile.release.build-override] opt-level = 0
    https://github.com/bytecodealliance/wasmtime/blob/a48196189a5e3b5e5f288f776062fb6e7189e43f/Cargo.toml#L177-L178

@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:meta Everything related to the meta-language. labels Aug 8, 2026
…cranelift-codegen (build-script run)

cranelift-srcgen: test: assert_eq without .trim()
@dishmaker
dishmaker force-pushed the dishmaker/perf_cc_formatter_buf branch from ac6344c to 2f06e9b Compare August 11, 2026 20:42
@dishmaker
dishmaker marked this pull request as ready for review August 11, 2026 20:44
@dishmaker
dishmaker requested a review from a team as a code owner August 11, 2026 20:44
@dishmaker
dishmaker requested review from fitzgen and removed request for a team August 11, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant