[Bug]: graphify query loads every language extractor just for _file_stem (about 34 ms per call)

オープン 初心者向け
#5,160 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@rohit-jsfreaky がすでに取り組んでいます。

2026年11月11日 から。

  • #5163 @rohit-jsfreaky による — オープン

評価

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

調査の方向性

graphify/build.py の graph_has_legacy_ids から始め、graphify.extractors.base から _file_stem をどのようにインポートしているかを追い、そのインポート経路をパッケージの extractor 読み込み動作と比較してください。報告されたインポート時のコマンドを使って、読み取り専用のクエリでもすべての言語 extractor が読み込まれるか確認してください。クエリと MCP のグラフ読み込みで不要なインポートを避けつつ、graph_has_legacy_ids の動作を維持できれば完了です。

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

説明

Pre-flight checks
  • I have checked the Troubleshooting section in the README
What happened?

graphify query (and the MCP server's graph load) imports every language extractor before answering. Both call graph_has_legacy_ids in graphify/build.py, which imports _file_stem from graphify.extractors.base. Importing that package loads all the extractors, about 55 ms, for a 3-line helper.

python -X importtime -m graphify query "..." on click: graphify.extractors costs about 34 ms of 229 ms of top-level imports. Agents call query many times per task, so this is paid on every call.

Steps to reproduce
cd click && graphify update .
python -X importtime -m graphify query "how does Context invoke a command" 2>&1 | grep graphify.extractors
Error output or graph output

graphify.extractors and the language extractor modules show up in the import trace of a read-only command.

Graphify version

0.9.106 (v8 at 35d1d203)

Operating System

Linux (measured), also Windows

Python Version

3.13

Installation Method

uv tool install (recommended)

主要言語
Python
スター
124k
フォーク
11.9k
平均マージ
2時間 35分
マージ済み PR(30日)
6

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

Graphify-Labs/graphify のほかの issue

Graphify-Labs/graphify の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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