Skip to content

feat: add benchmarking script#1252

Draft
roflmuffin wants to merge 1 commit intomainfrom
benchmarking
Draft

feat: add benchmarking script#1252
roflmuffin wants to merge 1 commit intomainfrom
benchmarking

Conversation

@roflmuffin
Copy link
Owner

Baseline:

Benchmark Results

  • Date: 2026-03-21T09:19:19.3384861Z
  • Iterations: 1,000,000
  • Warmup: 100,000

Mixed

Benchmark ns/call calls/sec total ms
Mixed workload (4 natives per iteration) 334 2,998,359 1334.06

Primitive Args

Benchmark ns/call calls/sec total ms
GetConvarFlags (ushort arg, ulong return) 377 2,651,967 377.08
GetConvarType (ushort arg, short return) 387 2,584,032 386.99

Primitive Return

Benchmark ns/call calls/sec total ms
GetEngineTime (double return, no args) 269 3,713,182 269.31
GetMaxClients (int return, no args) 252 3,961,253 252.45
GetTickCount (int return, no args) 238 4,195,553 238.35
GetTickInterval (float return, no args) 229 4,357,633 229.48
IsServerPaused (bool return, no args) 319 3,130,564 319.43

Schema

Benchmark ns/call calls/sec total ms
GetDeclaredClass via CBodyComponent (FastNew) 496 2,015,800 496.08
GetSchemaValue via Health property 110 9,093,000 109.97
Schema.GetSchemaOffset 4 different keys 90 11,094,503 360.54
Schema.GetSchemaOffset cached (record struct key) 190 5,255,720 190.27

String Push

Benchmark ns/call calls/sec total ms
FindConvar (string arg, pointer return) 451 2,218,009 450.85
PushString long (2000 bytes) 2,587 386,591 2586.71
PushString medium (200 bytes) 884 1,130,827 884.31
PushString overflow (9000 bytes) 9,833 101,703 9832.57
PushString short 'sv_cheats' (9 bytes) 434 2,304,171 434.00

String Return

Benchmark ns/call calls/sec total ms
GetConvarName (ushort arg, string return) 389 2,570,722 389.00
GetMapName (string return, no args) 239 4,188,841 238.73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant