branchrust_reboot/main/eventrecord_allocscancel
10 Commits over 0 Days - ∞cph!
Merge: from main
Tests: none, no conflicts
Clean: remove my testing setup
Test: none, trivial change
Optim: send small server-side analytics events using the same task thread
- Controlled via analytics.small_buffer_send_limit - to disable, set to -1, to enable for everything set to
999999
- Default to 16KB
- Preserved between server restarts
This avoids ~1KB of allocations just to schedule another async task per upload. On busy servers(100pop) this can save 0.8MB per frame.
Tests: booted in editor to check the command presence
Bugfix: EventRecord.AddField(bool) now respects it's param
Lucky for us, wasn't used anywhere outside of tests.
Tests: none, trivial change
Update: adding a couple perf tests for EventRecord
- also removed one of profilign scopes since I don't need it anymore
Used them to check if packing EventRecordField would give any perf benefit, and it's a no - indistinguishable from noise.
Tests: ran the new tests
Optim: Allocate scratch buffer on the stack instead of thread local mem
Perf tests showed same performance, so we can save on the global allocation
Tests: ran editor on craggy
Optim: avoid scratch buffer round trip
After checking internals, GUID serialization is also alloc-free, so routing through that.
Tests: profiled in editor
Optim: eliminate float/double related allocs in EventRecordField.Serialize
Need to run a couple additional experiments(stackalloc, tagged union), but this part is basically done.
Tests: ran in editor, observed in profiler that no more allocs are happening in Serialize for small records
Optim: EventRecordField - use thread local scratch to avoid GUID serialization allocs
Tests: validated value via debugging, unity profiler showed no allocs during Serialize(CSV) call
Update: hacky EventRecord profiling setup to track allocations
Will need to discard this before merge
Tests: ran in editor