Skip to content

Conversation

@jakebailey
Copy link
Member

@jakebailey jakebailey commented Dec 13, 2025

This should eliminate the performance woes of formatting with exec + go tool gofumpt (especially on Windows).

Benchmark 1: dprint fmt --incremental=false (branch = main)
  Time (mean ± σ):     42.703 s ±  0.412 s    [User: 0.733 s, System: 0.569 s]
  Range (min … max):   41.742 s … 43.399 s    10 runs
 
Benchmark 2: dprint fmt --incremental=false (branch = jabaile/gofumpt-plugin)
  Time (mean ± σ):     633.1 ms ±  14.8 ms    [User: 4887.2 ms, System: 1083.9 ms]
  Range (min … max):   617.3 ms … 663.2 ms    10 runs
 
Summary
  dprint fmt --incremental=false (branch = jabaile/gofumpt-plugin) ran
   67.45 ± 1.70 times faster than dprint fmt --incremental=false (branch = main)

Not in this PR is removing the tool, since we still format generated files. That will be a more invasive change.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the Go code formatting setup by replacing the exec-based dprint plugin (which runs go tool mvdan.cc/gofumpt as an external command) with a dedicated WebAssembly-based gofumpt plugin. This change should significantly improve formatting performance, especially on Windows where process spawning is more expensive.

Key Changes:

  • Replaced exec plugin configuration with native gofumpt Wasm plugin
  • Configured langVersion to "go1.25" to match the project's Go version
  • Set modulePath to the project's module identifier

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