Skip to content

test: add benchmarking script#1252

Merged
roflmuffin merged 9 commits intomainfrom
benchmarking
Mar 23, 2026
Merged

test: add benchmarking script#1252
roflmuffin merged 9 commits intomainfrom
benchmarking

Conversation

@roflmuffin
Copy link
Copy Markdown
Owner

@roflmuffin roflmuffin commented Mar 21, 2026

Baseline:

Benchmark Results

  • Branch: benchmarking
  • Commit: ae604f1
  • Date: 2026-03-23T06:10:56.0323144Z
  • Iterations: 1,000,000
  • Warmup: 100,000

Entity Lifecycle

Benchmark ns/call calls/sec total ms
Entity create+spawn info_target 11,029 90,672 11022.37
GetPlayerFromSlot 580 1,723,115 580.34

GameEvent

Benchmark ns/call calls/sec total ms
GameEvent Fire 4,211 237,494 4210.64

Mixed

Benchmark ns/call calls/sec total ms
Mixed (4 natives/iter) 338 2,954,253 1353.98

NetMessage

Benchmark ns/call calls/sec total ms
NetMessage Send 18,733 53,380 18733.49

Primitive Args

Benchmark ns/call calls/sec total ms
GetConvarFlags (ushort → ulong) 415 2,412,189 414.56
GetConvarType (ushort → short) 422 2,369,029 422.11

Primitive Return

Benchmark ns/call calls/sec total ms
GetEngineTime (double, no args) 251 3,988,634 250.71
GetMaxClients (int, no args) 234 4,278,928 233.70
GetServerCurrentTime (float, no args) 257 3,888,808 257.15
GetTickCount (int, no args) 220 4,553,958 219.59
GetTickInterval (float, no args) 230 4,356,317 229.55
IsServerPaused (bool, no args) 301 3,327,530 300.52

Schema

Benchmark ns/call calls/sec total ms
GetDeclaredClass (CBodyComponent) 475 2,103,549 475.39
GetSchemaValue (Health) 124 8,092,199 123.58
SchemaOffset 4 keys 103 9,694,502 412.60
SchemaOffset cached 99 10,092,039 99.09

String Push

Benchmark ns/call calls/sec total ms
FindConvar (string → pointer) 475 2,106,684 474.68
PushString 200 bytes 766 1,304,712 766.45
PushString 2000 bytes 2,601 384,477 2600.93
PushString 9 bytes 432 2,317,416 431.52
PushString 9000 bytes (overflow) 9,880 101,214 9880.03

String Return

Benchmark ns/call calls/sec total ms
GetConvarName (ushort → string) 409 2,443,698 409.22
GetMapName (string, no args) 368 2,715,072 368.31

Virtual Function

Benchmark ns/call calls/sec total ms
VFunc IsPlayerPawn (high-level API) 2,903 344,529 2902.52
VFunc IsPlayerPawn (pre-created delegate) 758 1,319,240 758.01

@roflmuffin roflmuffin marked this pull request as ready for review March 23, 2026 06:15
@roflmuffin roflmuffin changed the title feat: add benchmarking script test: add benchmarking script Mar 23, 2026
@roflmuffin roflmuffin merged commit 1dbed74 into main Mar 23, 2026
8 checks passed
@roflmuffin roflmuffin deleted the benchmarking branch March 23, 2026 06:29
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