==============================================================================
construct-rs parse 内核分阶段计时（234ns/field 开销定位）
==============================================================================

环境信息：
  Python 版本    : 3.14.2
  平台           : Windows-11-10.0.26200-SP0
  处理器         : Intel64 Family 6 Model 183 Stepping 1, GenuineIntel
  timeit number  : 10000
  repeat (中位数): 3
  字段数 N       : 100 (B4 配置)
  测量时间       : 2026-06-22 02:53:44

测量点说明：
  1. Flat.parse(data)              —— Rust 全流程（基线）
  2. struct.unpack × N             —— 纯 C 层字节解包
  3. int.from_bytes + dict set_item —— PyLong 构造 + PyDict_SetItem
  4. object.__new__ + setattr × N  —— 实例 + 逐字段 setattr
  5. __new__ + __dict__ 整体替换   —— Rust 路径的 Python 等价
  6. Python construct 2.10.70      —— 绝对基线

==============================================================================
分阶段计时结果（N=100 字段 Int32ub）
==============================================================================

| #  | 测量点                              |  median (ns) |     min (ns) |
|----------------------------------------------------------------------------|
| 1  | 完整 parse (Flat.parse) [Rust 全流程] |      23732.2 |      23722.1 |
| 2  | Python struct.unpack × N         |       8812.7 |       8805.4 |
| 3  | int.from_bytes + dict set_item × N |      15105.3 |      15089.1 |
| 4  | object.__new__ + setattr × N     |       4025.9 |       4019.4 |
| 5  | __new__ + __dict__ 整体替换          |      15371.4 |      15365.2 |
| 6  | Python construct 2.10.70 baseline |      42648.6 |      42604.2 |

==============================================================================
每字段开销分解（实测 vs 理论）
==============================================================================

每字段平均开销（ns/field）：

  Rust 全流程（测量点 1）        :  237.32 ns/field
  Python struct.unpack（测量点 2）:   88.13 ns/field
  PyLong+dict（测量点 3）         :  151.05 ns/field
  setattr × N（测量点 4）         :   40.26 ns/field
  __dict__ 替换（测量点 5）       :  153.71 ns/field
  Python construct（测量点 6）    :  426.49 ns/field

增量分析：
  纯 C 层 struct.unpack 成本        :   88.13 ns/field  (测量点 2 / N)
  PyLong 构造 + dict SetItem 增量   :   62.93 ns/field  (测量点 3 - 测量点 2)
  object.__new__ + setattr × N     :   40.26 ns/field  (测量点 4 / N)

==============================================================================
Rust 内核 vs 理论下界（Python 等价操作之和）
==============================================================================

理论下界（Python 侧各阶段之和）：
  纯 struct.unpack (C 层)         :   88.13 ns/field
  + PyLong 构造 + dict SetItem    :   62.93 ns/field
  + 实例构造摊销(__new__+替换)   :    2.66 ns/field
  ────────────────────────────────────────────
  合计理论下界                    :  153.71 ns/field

  Rust 实测（测量点 1 / N）       :  237.32 ns/field
  差距（Rust - 理论下界）         :   83.61 ns/field  ← 不明开销

==============================================================================
加速比对比
==============================================================================

  Rust vs Python construct        :  1.80x
  Rust vs 测量点 3 (PyLong+dict)  :  0.64x
  Rust vs 测量点 5 (__dict__ 替换):  0.65x

==============================================================================
Python 基线稳定性确认（同环境同时测量）
==============================================================================

  测量点 6 median : 42648.6 ns
  测量点 6 min    : 42604.2 ns
  抖动 (med-min)/med : 0.10%
  解析：抖动 < 5% 视为环境稳定


原始 JSON：
  RS  : {"m1_full_parse": 23732.24999755621, "m1_full_parse_min": 23722.090001683682, "m2_struct_unpack": 8812.740002758801, "m2_struct_unpack_min": 8805.42999948375, "m3_int_from_bytes_dict": 15105.260000564158, "m3_int_from_bytes_dict_min": 15089.140000054613, "m4_new_then_setattr": 4025.86999698542, "m4_new_then_setattr_min": 4019.4200002588336, "m5_new_then_replace_dict": 15371.360001154246, "m5_new_then_replace_dict_min": 15365.150000434369, "n": 100}
  PY  : {"m6_python_construct": 42648.590001044795, "m6_python_construct_min": 42604.15000026114, "n": 100}