-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Problem
AST2BlockList._propertyOf() repeatedly:
- scans
config.body_blocksto resolve each block's metadata - recomputes connection slot indices (
prev,child,next,second_child) via repeatedindexOf
During large AST-to-blockList conversions, this becomes avoidable overhead in a hot path.
Why It Matters
JS import/export conversion speed impacts responsiveness when handling larger projects.
Proposed Change
- Precompute a
blockName -> config entrymap once pertoBlockList()call. - Cache computed connection indices per connection-array object and reuse them.
Scope
- File:
js/js-export/ast2blocklist.js - Methods:
_treeToBlockList()/_propertyOf()
Acceptance Criteria
- Output blockList structure and ordering remain unchanged.
- Fallback behavior for unknown blocks remains unchanged.
- Repeated linear scans/index lookups in
_propertyOf()are removed or minimized via caching. - Existing
ast2blocklisttests pass.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels