- 实测 tp_new + 逐字段 SetAttr 与 PyObject_Vectorcall 打平(基准 0.9x,略慢):PyTuple_New(0) + _fields 缓存查询 + slots 名称线性查找开销抵消 Python 帧收益 - 回退并注释说明:要降低 _Init 19.7s 需 tp_members.offset 偏移直写(风险较高另行评估)
- 实测 tp_new + 逐字段 SetAttr 与 PyObject_Vectorcall 打平(基准 0.9x,略慢):PyTuple_New(0) + _fields 缓存查询 + slots 名称线性查找开销抵消 Python 帧收益 - 回退并注释说明:要降低 _Init 19.7s 需 tp_members.offset 偏移直写(风险较高另行评估)