|
| 1 | +internal static class BenchmarkCatalog |
| 2 | +{ |
| 3 | + public static Dictionary<string, BenchmarkDefinition> Build() |
| 4 | + { |
| 5 | + return new Dictionary<string, BenchmarkDefinition>(StringComparer.OrdinalIgnoreCase) |
| 6 | + { |
| 7 | + ["visibility"] = new( |
| 8 | + Name: "visibility", |
| 9 | + Description: "Measures allocations and timing for VisibilitySystem.Update().", |
| 10 | + ParameterNames: ["Entities", "Effects", "Updates"], |
| 11 | + DefaultScenarios: |
| 12 | + [ |
| 13 | + new Scenario(40, 1, 20), |
| 14 | + new Scenario(40, 8, 20), |
| 15 | + new Scenario(64, 8, 10) |
| 16 | + ], |
| 17 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated update calls after one warm-up run.", |
| 18 | + SupportsLegacyComparison: true, |
| 19 | + CreateSampleResult: Measurements.MeasureVisibilitySample), |
| 20 | + |
| 21 | + ["audio-effects"] = new( |
| 22 | + Name: "audio-effects", |
| 23 | + Description: "Measures allocations and timing for audio effect collection reads.", |
| 24 | + ParameterNames: ["Effects", "Reads", "Unused"], |
| 25 | + DefaultScenarios: |
| 26 | + [ |
| 27 | + new Scenario(1, 10_000, 0), |
| 28 | + new Scenario(4, 10_000, 0), |
| 29 | + new Scenario(8, 10_000, 0) |
| 30 | + ], |
| 31 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated effect collection reads after one warm-up run.", |
| 32 | + SupportsLegacyComparison: true, |
| 33 | + CreateSampleResult: Measurements.MeasureAudioEffectsSample), |
| 34 | + |
| 35 | + ["tcp-frame-read"] = new( |
| 36 | + Name: "tcp-frame-read", |
| 37 | + Description: "Measures allocations and timing for TCP frame read and payload parsing.", |
| 38 | + ParameterNames: ["Packets", "PacketBytes", "Frames"], |
| 39 | + DefaultScenarios: |
| 40 | + [ |
| 41 | + new Scenario(4, 64, 1_000), |
| 42 | + new Scenario(8, 256, 1_000), |
| 43 | + new Scenario(16, 512, 500) |
| 44 | + ], |
| 45 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated TCP frame read/parse operations.", |
| 46 | + SupportsLegacyComparison: true, |
| 47 | + CreateSampleResult: Measurements.MeasureTcpFrameReadSample), |
| 48 | + |
| 49 | + ["tcp-write-payload"] = new( |
| 50 | + Name: "tcp-write-payload", |
| 51 | + Description: "Measures allocations and timing for TCP response frame formatting.", |
| 52 | + ParameterNames: ["Packets", "PacketBytes", "Frames"], |
| 53 | + DefaultScenarios: |
| 54 | + [ |
| 55 | + new Scenario(4, 64, 1_000), |
| 56 | + new Scenario(8, 256, 1_000), |
| 57 | + new Scenario(16, 512, 500) |
| 58 | + ], |
| 59 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated TCP response frame writes into memory.", |
| 60 | + SupportsLegacyComparison: true, |
| 61 | + CreateSampleResult: Measurements.MeasureTcpWritePayloadSample), |
| 62 | + |
| 63 | + ["http-packed-packets"] = new( |
| 64 | + Name: "http-packed-packets", |
| 65 | + Description: "Measures allocations and timing for HTTP packed packet decode and encode.", |
| 66 | + ParameterNames: ["Packets", "PacketBytes", "Requests"], |
| 67 | + DefaultScenarios: |
| 68 | + [ |
| 69 | + new Scenario(4, 64, 1_000), |
| 70 | + new Scenario(8, 256, 500), |
| 71 | + new Scenario(16, 512, 250) |
| 72 | + ], |
| 73 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated HTTP packed-packet decode/encode operations.", |
| 74 | + SupportsLegacyComparison: false, |
| 75 | + CreateSampleResult: Measurements.MeasureHttpPackedPacketsSample), |
| 76 | + |
| 77 | + ["http-auth-path"] = new( |
| 78 | + Name: "http-auth-path", |
| 79 | + Description: "Measures allocations and timing for HTTP bearer auth, packet decode, validation, and in-memory dispatch.", |
| 80 | + ParameterNames: ["Packets", "PacketBytes", "Requests"], |
| 81 | + DefaultScenarios: |
| 82 | + [ |
| 83 | + new Scenario(1, 32, 5_000), |
| 84 | + new Scenario(4, 64, 2_000), |
| 85 | + new Scenario(8, 128, 1_000) |
| 86 | + ], |
| 87 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated HTTP auth-path request handling without sockets.", |
| 88 | + SupportsLegacyComparison: false, |
| 89 | + CreateSampleResult: Measurements.MeasureHttpAuthPathSample), |
| 90 | + |
| 91 | + ["wss-data-tunnel"] = new( |
| 92 | + Name: "wss-data-tunnel", |
| 93 | + Description: "Measures allocations and timing for WSS data tunnel decode, packet slicing, and response encoding.", |
| 94 | + ParameterNames: ["Packets", "PacketBytes", "Commands"], |
| 95 | + DefaultScenarios: |
| 96 | + [ |
| 97 | + new Scenario(4, 64, 1_000), |
| 98 | + new Scenario(8, 256, 500), |
| 99 | + new Scenario(16, 512, 250) |
| 100 | + ], |
| 101 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated WSS data-tunnel command handling.", |
| 102 | + SupportsLegacyComparison: false, |
| 103 | + CreateSampleResult: Measurements.MeasureWssDataTunnelSample), |
| 104 | + |
| 105 | + ["mcapi-broadcast-fanout"] = new( |
| 106 | + Name: "mcapi-broadcast-fanout", |
| 107 | + Description: "Measures allocations and timing for McApi packet serialization and broadcast fanout across peers.", |
| 108 | + ParameterNames: ["Peers", "PacketBytes", "Broadcasts"], |
| 109 | + DefaultScenarios: |
| 110 | + [ |
| 111 | + new Scenario(16, 64, 2_000), |
| 112 | + new Scenario(64, 256, 1_000), |
| 113 | + new Scenario(256, 512, 250) |
| 114 | + ], |
| 115 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated McApi broadcast calls.", |
| 116 | + SupportsLegacyComparison: false, |
| 117 | + CreateSampleResult: Measurements.MeasureMcApiBroadcastFanoutSample), |
| 118 | + |
| 119 | + ["event-handler-burst"] = new( |
| 120 | + Name: "event-handler-burst", |
| 121 | + Description: "Measures allocations and timing for EventHandlerSystem task bursts drained through Update().", |
| 122 | + ParameterNames: ["QueuedTasks", "VisiblePeers", "Bursts"], |
| 123 | + DefaultScenarios: |
| 124 | + [ |
| 125 | + new Scenario(32, 8, 500), |
| 126 | + new Scenario(64, 32, 250), |
| 127 | + new Scenario(128, 64, 100) |
| 128 | + ], |
| 129 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated event-enqueue bursts and queue draining.", |
| 130 | + SupportsLegacyComparison: false, |
| 131 | + CreateSampleResult: Measurements.MeasureEventHandlerBurstSample), |
| 132 | + |
| 133 | + ["entity-create-sync"] = new( |
| 134 | + Name: "entity-create-sync", |
| 135 | + Description: "Measures allocations and timing for initial McApi peer sync of effects and entity snapshots.", |
| 136 | + ParameterNames: ["Entities", "Effects", "Connects"], |
| 137 | + DefaultScenarios: |
| 138 | + [ |
| 139 | + new Scenario(16, 4, 500), |
| 140 | + new Scenario(64, 8, 250), |
| 141 | + new Scenario(128, 16, 100) |
| 142 | + ], |
| 143 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated simulated peer-connect sync runs.", |
| 144 | + SupportsLegacyComparison: false, |
| 145 | + CreateSampleResult: Measurements.MeasureEntityCreateSyncSample), |
| 146 | + |
| 147 | + ["audio-effect-process"] = new( |
| 148 | + Name: "audio-effect-process", |
| 149 | + Description: "Measures allocations and timing for applying audio effects across entities and audio buffers.", |
| 150 | + ParameterNames: ["Effects", "Entities", "Runs"], |
| 151 | + DefaultScenarios: |
| 152 | + [ |
| 153 | + new Scenario(4, 8, 2_000), |
| 154 | + new Scenario(8, 32, 1_000), |
| 155 | + new Scenario(16, 64, 250) |
| 156 | + ], |
| 157 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated audio effect processing passes.", |
| 158 | + SupportsLegacyComparison: false, |
| 159 | + CreateSampleResult: Measurements.MeasureAudioEffectProcessSample), |
| 160 | + |
| 161 | + ["jitter-buffer"] = new( |
| 162 | + Name: "jitter-buffer", |
| 163 | + Description: "Measures allocations and timing for JitterBuffer add and drain cycles.", |
| 164 | + ParameterNames: ["Packets", "PacketBytes", "Runs"], |
| 165 | + DefaultScenarios: |
| 166 | + [ |
| 167 | + new Scenario(128, 160, 100), |
| 168 | + new Scenario(512, 160, 50), |
| 169 | + new Scenario(1_024, 320, 25) |
| 170 | + ], |
| 171 | + MeasurementDescription: "Steady-state allocations and elapsed time across repeated JitterBuffer fill/drain runs.", |
| 172 | + SupportsLegacyComparison: false, |
| 173 | + CreateSampleResult: Measurements.MeasureJitterBufferSample) |
| 174 | + }; |
| 175 | + } |
| 176 | +} |
0 commit comments