Files
TransPyC/lib/vast
TermiNexus 9605af8ea1 perf(vast): AST 节点类加 __slots__,去 __dict__ 提速降内存
AST 基类 __slots__=(),131 个动态节点类按 fields+attrs 生成 __slots__,
_Init 改 object.__setattr__;类默认值改为 _node_defaults 字典(原类属性
与 __slots__ 冲突)。解析提速 ~9%,实例内存 Name 由 48B+独立 dict 降为
80B 平铺,无 __dict__ 残留。Python 3.12 pickle 对 __slots__ 类开箱即用
(__reduce_ex__(2)),131 类 pickle roundtrip 全过,vast 差分 51/53 0 FAIL。
2026-08-17 23:27:43 +08:00
..