Files
Workspace/Assets/Modules/ShrinkEventBus/Benchmark.txt
T
cneicy d74c2f08ca feat(packages): 内置 SDK 包并完善 ContextLoader 集成
- 将 ShrinkEventBus、ShrinkDataSaver 及其 EventBus 集成从 gitlink 转为仓库直接维护的完整 UPM 包,补齐运行时、编辑器工具、测试与文档
- 新增 Command 和 Network 的 App 集成组件,支持 ContextLoader 服务发布、可逆注销及 Network Loopback 生命周期管理
- 更新 Starter 与演示组合逻辑,缺失模块时可注册、已有兼容安装器时可覆盖,并补充宿主启动断言
- 升级内部包依赖与 Shared CodeGen 包定义,放宽 Integration.App 包的 Git 忽略规则
- 将独立服务器生成器改为基于已编译程序集的语义扫描,支持 partial、复杂泛型、命名冲突检测及模板 SHA-256 覆写保护
- 新增 Network 语义扫描、模板保护和 App 组件生命周期测试
- 新增真实 UPM 消费工程验证脚本,校验内部版本一致性、程序集加载及 EditMode 测试
- 重构当前架构文档并归档已完成的 Cordis 迁移与旧代码地图
2026-08-18 18:06:34 +08:00

84 lines
3.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
╔══════════════════════════════════════════════════╗
║ ShrinkEventBus Benchmark Report ║
║ iter= 1000000 mass= 10000 reg= 5000 scan=1000 ║
╚══════════════════════════════════════════════════╝
基准对象:独立实例 busAllowPerPhaseDispatch 已开启)
采集于 1.3.0EventBase 瘦身后;Unity 2022.3.62f3, Editor Play Mode
▶ TriggerEvent × 无订阅者(基线)
总耗时 : 111.466 ms
单次 : 0.1115 μs/op
吞吐量 : 8971378 ops/s
▶ TriggerEvent × 单订阅者同步
总耗时 : 163.073 ms
单次 : 0.1631 μs/op
吞吐量 : 6132242 ops/s
▶ TriggerEvent × 父事件监听子事件
总耗时 : 171.424 ms
单次 : 0.1714 μs/op
吞吐量 : 5833479 ops/s
▶ TriggerEvent × 30 订阅者同步
总耗时 : 38.639 ms
单次 : 3.8639 μs/op
吞吐量 : 258805 ops/s
▶ TriggerEvent(Phase=HIGH) × 3 phase 监听
总耗时 : 164.197 ms
单次 : 0.1642 μs/op
吞吐量 : 6090238 ops/s
▶ TriggerEventAsync × 单订阅者异步
总耗时 : 0.856 ms
单次 : 0.8557 μs/op
吞吐量 : 1168634 ops/s
▶ RegisterEvent(delegate)
总耗时 : 14.418 ms
单次 : 2.8836 μs/op
吞吐量 : 346791 ops/s
▶ UnregisterEvent(delegate)
总耗时 : 3.427 ms
单次 : 0.6853 μs/op
吞吐量 : 1459130 ops/s
▶ Register/Unregister(instance scan)
总耗时 : 13.097 ms
单次 : 13.0971 μs/op
吞吐量 : 76353 ops/s
▶ Register/Unregister(static type scan)
总耗时 : 9.337 ms
单次 : 9.3374 μs/op
吞吐量 : 107096 ops/s
▶ Register/Unregister(MethodInfo)
总耗时 : 6.513 ms
单次 : 6.5134 μs/op
吞吐量 : 153530 ops/s
▶ TriggerEvent × new() [GC Gen0= 1]
总耗时 : 266.536 ms
单次 : 0.2665 μs/op
吞吐量 : 3751843 ops/s
▶ TriggerEvent × Pool.Get() [GC Gen0= 0]
总耗时 : 242.015 ms
单次 : 0.2420 μs/op
吞吐量 : 4131982 ops/s
▶ TriggerEvent × 已取消事件跳过(10 订阅者)
总耗时 : 52.777 ms
单次 : 0.5278 μs/op
吞吐量 : 1894776 ops/s
══════════════════════════════════════════════════
全部测试完成
对比 1.1.x 旧样本:new() 路径 7684ms / GC Gen0=6457 → 266ms / GC Gen0=1
(EventBase 不再每实例分配内置 ListenerListnew() 路径 GC 基本归零,
对象池从“高频必需”降级为可选优化。)