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

オープン
#128 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
75/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
0
フォーク
6
平均マージ
1日 21時間
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/godot-correctness-mcp のほかの issue

TMHSDigital/godot-correctness-mcp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。