Perf regression: golang/rescan wall +34% (1d523d30, #1403)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend, performance
Línea de trabajo
Start in patch/redirect/mod.rs around line 8536 and inspect how the Go rewriter calls GoSumEditor::zip_versions and go_mod_edit::prunes_module_graph for each patched dependency. Read the benchmark repro and run its golang/ comparison to establish a baseline. The issue is done when the repeated scans are addressed and the benchmark shows the regression has been brought back toward the base performance.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[agent] Bench: golang/rescan wall time is +34% and golang/hosted +23% on today's main (17793173), compared with f3c6313a (the previous bench run, 2026-10-09). Request counts are unchanged (64).
Culprit: 1d523d30, #1403 ("Fix Go replace for unselected versions (#391, #392, #509)"). Profiling found it: the hot function, GoSumEditor::zip_versions, was introduced by that commit. It was not bisected with builds.
Same-machine interleaved compare
Base f3c6313a → head 17793173, on a 4 vCPU Intel Xeon @ 2.10GHz cloud sandbox. An A/A run on the same machine was clean (golang/rescan +2.6%, ≈).
| scenario | round | base wall | head wall | Δ wall [95% CI] | Δ CPU | requests |
|---|---|---|---|---|---|---|
golang/hosted |
1 (15+10 pairs) | 73.0 ms | 94.5 ms | +27.3% [+18.5, +36.3] | +26.8% | 64 |
golang/hosted |
2 (20+10 pairs) | 70.6 ms | 87.2 ms | +23.4% [+14.6, +32.1] | +27.7% | 64 |
golang/rescan |
1 | 67.1 ms | 95.2 ms | +45.5% [+33.9, +51.1] | +37.2% | 64 |
golang/rescan |
2 | 67.0 ms | 88.2 ms | +34.3% [+26.4, +39.0] | +31.0% | 64 |
Hot spot
Callgrind on the head binary, golang/rescan (1200 modules, 30 patched), inclusive instructions:
68.3% patch::redirect::rewriter_groups::{{closure}}
30.4% vendor::go_sum_edit::GoSumEditor::zip_versions
29.0% <SplitWhitespace as Iterator>::next
15.9% vendor::go_mod_edit::scan_hosted_replace
10.3% go_mod_edit::strip_comment
The golang rewriter (patch/redirect/mod.rs, around line 8536) calls go_sum.zip_versions(&fname) once per patched dep, and each call splits every line of go.sum. That makes it O(patched deps × go.sum lines). go_mod_edit::prunes_module_graph(&go_mod) is also evaluated per dep. One pass over go.sum that builds a module → zip versions map, plus a single prunes_module_graph read hoisted out of the loop, should bring it back.
Repro
export CARGO_PROFILE_PERF_INHERITS=release CARGO_PROFILE_PERF_LTO=thin CARGO_PROFILE_PERF_STRIP=none
git worktree add /tmp/base f3c6313a && (cd /tmp/base && CARGO_TARGET_DIR=/tmp/tb cargo build --locked --profile perf -p socket-patch-cli)
CARGO_TARGET_DIR=/tmp/th cargo build --locked --profile perf -p socket-patch-cli -p socket-patch-bench
/tmp/th/perf/socket-patch-bench compare --base /tmp/tb/perf/socket-patch --head /tmp/th/perf/socket-patch -f '^golang/' --runs 20
Runner: nproc 4, Intel(R) Xeon(R) Processor @ 2.10GHz.
Generated by Claude Code
- Lenguaje dominante
- Rust
- Estrellas
- 8
- Forks
- 1
- Merge medio
- 17 h 5 min
- PR fusionados (30 d)
- 557
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SocketDev/socket-patch
-
agent:triaged bug bughunt pm:npm priority:p3 ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
SocketDev/socket-patch#1072 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
agent:triaged bug bughunt pm:yarn-berry priority:p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
SocketDev/socket-patch#783 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Vendored cargo warns cargo_multi_version_old_cargo ("declares no rust-version") when the root package inherits rust-version from [workspace.package]Posiblemente ocupada @mikolalysenko la tomó hace 2 días. Abiertoagent:triaged bug bughunt pm:cargo priority:p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
SocketDev/socket-patch#651 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug bughunt pm:npm
Dificultad 4/5 1-2 días Aptitud para principiantes 45/100
SocketDev/socket-patch#1534 ·
Los mantenedores suelen responder en 1 día
-
agent:triaged bug bughunt pm:bundler priority:p1
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
SocketDev/socket-patch#1531 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de SocketDev/socket-patch
Issues similares
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsPosiblemente ocupada @roboomp la tomó hoy. Abiertobug prio:p2 providers triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
can1357/oh-my-pi#15798 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/datafusion-comet#7001 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
builtin-port enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
cmlarsen/writemorebetter#235 ·
Los mantenedores suelen responder en 1 día
-
Add a Storybook section to CONTRIBUTING.mdPosiblemente ocupada @ChanakyaG2004 la tomó hoy. Abiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
FlowwStar/FlowStar#995 · 2 comentarios ·
Los mantenedores suelen responder en 1 día