delta-misuse walks each function twice, about 20% of lint time

Abierto
#128 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
75/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Read src/gdscript/ast.ts around walkSubtree and functionCalls, then inspect src/lint/rules/delta-misuse.ts:72-75 to trace the repeated traversal. Run npm run build && npm test and compare per-rule timing on the fixture set. Done means existing delta-misuse findings are unchanged and its timing is no higher than any other rule.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

good first issue performance severity: medium

Summary

delta-misuse walks each function subtree twice, re-marshalling every node through web-tree-sitter namedChildren. It accounts for about 20% of total lint time even after the shared traversal (#85).

Where

  • src/lint/rules/delta-misuse.ts:72-75
  • src/gdscript/ast.ts:13-21 (walkSubtree), src/gdscript/ast.ts:128-135 (functionCalls)

Details

Per-rule timing over 500 files, with the shared index already built:

Rule Time
delta-misuse 354 ms (about 0.7 ms per file)
connect-without-disconnect 94 ms
stringly-nodepath 83 ms
every other rule under 20 ms

Total lint cost is about 3.1 to 4.2 ms per file, so on 3000 files delta-misuse costs about 2.1 s of a 9 to 12 s run. In the CPU profile, marshalNode, walkSubtree and get type are the top JS self-time entries.

Suggested fix

For non-root nodes, have walk(node) return the contiguous pre-order slice of the per-tree index (from the node's position until startIndex >= node.endIndex), and compute callsMove in that same single pass. This also speeds up the other subtree walkers.

Acceptance criteria

  • delta-misuse findings are unchanged on the existing tests.
  • delta-misuse costs no more than any other rule in a per-rule timing over a fixture set.

Getting started

  • Relevant files: src/gdscript/ast.ts, src/lint/rules/delta-misuse.ts
  • How to run tests: npm run build && npm test

Filed by repo-audit/full-audit at e836036. Severity: medium. Effort: S. audit-key: performance|src/lint/rules/delta-misuse.ts|check

Lenguaje dominante
TypeScript
Estrellas
0
Forks
6
Merge medio
1 d 21 h
PR fusionados (30 d)
8

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/godot-correctness-mcp

Todos los issues de TMHSDigital/godot-correctness-mcp

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.