Files
codebase-memory-mcp/internal/cbm/lsp
Shane McCarron 0815d78377 fix(perl-lsp): iterate wide AST children via cursor, batch method-table build
Two O(n^2) patterns in the Perl LSP, the class the ARM
extract_wide_flat_file_is_linear guard flags:

- Every child-iteration loop used indexed ts_node_child(node, i), which is
  O(i) per call and O(n^2) over a wide flat node. Route them all through a new
  perl_collect_children() helper mirroring wd_collect_children() in
  extract_defs.c: a forward TSTreeCursor collect for wide nodes (>= 64
  children), NULL (cheap indexed access) for the small common case.

- perl_attach_methods rebuilt each package's whole NULL-terminated method
  array on every sub via perl_type_add_method, O(subs^2) on a single-package
  file. Replace with a collect -> qsort-by-package -> build-once batch
  (O(S log S)); source order within a package is preserved so first-defined
  still wins on redefinition.

No behavior change: all perllsp_* resolution tests and
lsp_perl_deep_expression_no_crash pass; check-lsp-originality.sh reports clean.

Signed-off-by: Shane McCarron <shane.mccarron@corvexconnect.com>
2026-07-09 14:47:33 -05:00
..
2026-07-09 14:09:39 -05:00
2026-06-03 02:13:30 +02:00
2026-06-03 02:13:30 +02:00
2026-06-03 02:13:30 +02:00
2026-06-03 02:13:30 +02:00