Slow compilation of large lexical scopes

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

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

@0x5457 がすでに取り組んでいます。

2026年11月25日 から。

  • #1954 @0x5457 による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, javascript

調査の方向性

Reproduce the compile time first with the commands in the report: npm pack [email protected], extract package/dist/umd/lucide-react.js, then time ./build/qjsc -o /tmp/lucide-react.c /tmp/lucide-react.js over 11 runs. Then read find_var_in_child_scope() and find_lexical_decl(), which the report flags as scanning existing bindings during declaration checks, plus the local name-resolution walk over the binding chain. Done means a large flat const scope compiles without the per-declaration scan blowing up, verified by the same timing loop.

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

説明

The published [email protected] UMD bundle has 3,287 const bindings in one function. On QuickJS-NG d06a85c, it took 140 ms to compile. I saw the same slowdown with the CommonJS entry from @tabler/[email protected]: 972 ms with the standard Node wrapper.

Both timings are compile-only medians over 11 runs on Linux x86-64, GCC 14.2, -O2.

npm pack [email protected] --silent
tar -xOf lucide-react-0.548.0.tgz package/dist/umd/lucide-react.js > /tmp/lucide-react.js
./build/qjsc -o /tmp/lucide-react.c /tmp/lucide-react.js

find_var_in_child_scope() and find_lexical_decl() scan existing bindings during declaration checks. Local name resolution also walks the binding chain.

主要言語
C
スター
3.9k
フォーク
389
平均マージ
2日 2時間
マージ済み PR(30日)
19

環境構築

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

はじめの一歩

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

quickjs-ng/quickjs のほかの issue

quickjs-ng/quickjs の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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