1,163 Commits over 304 Days - 0.16cph!
Bugfix: ProfileExporter.JSON - gracefully handle managed allocations coming from native runtime
- Emit "<mono-native-runtime>" if we don't have managed callstack
Finally caught it - this can happen when mono tries to invoke a managed callback which requires a managed allocation (the callback accepts string[], for example) as a first method in managed code. Was able to repro in editor due to it's script compilation callbacks.
Tests: triggered perfsnapshot 40 times without issues
Bugfix: ProfileExporter - avoid reading allocs at the start of the frame as method-entries
- Added a bunch of temporary logging to help track down last issue
Rare, but legal due to our filtering of code.
Tests: snapshotted a bunch of times in editor (there's still one issue with main thread export)
Update: ProfileBinViewer displays binary offsets for marks
Tests: opened a couple bin snapshots
Bugfix: avoid out-of-bounds access when scanning for alloc-only threads
Fixes perf snapshot export failing to generate while processing worker threads. There's still a rare case of main thread crashing - investigating
Tests: Exported a snapshot in editor
Update: ProfileBinViewer can now grok the new profile .bin files
Tests: opened bin profile from editor
Update: rewrite ServerProfile exporters to work with new data layour
- expanded unit test
- Core binary should be the same, but copied from the freshest release build
- purposefully borked ProfileBinViewer - will fix next
Tests: unit tests & took a snapshot on craggy
Update: Rewrote how ServerProfiler.Core stores profiling data
- got a 2% improvement on 1mil empty call benchmark
It will be easier to add new features to the profiler (user scopes, user counters, continuous capture). Need to rewrite the exporters now.
Tests: unit tests
Tests: perf test to measure ServerProfiler overhead
Going to try a different internal storage approach to make future changes easier (and potentially faster)
Tests: ran the new tests
Merge: from parallel_validatemove
- Removes PlayerCache.ValidPlayers allocs
Tests: took a snapshot on Craggy in editor
Optim: PlayerCache.ValidPlayers no longer allocates garbage
Tests: took snapshot on Craggy in editor to confirm
Merge: from main
Tests: none, no conflicts
Merge: from profiling_improvements
- Reduces overhead of serializing to/from ProtoBuf by not tracking BufferStream calls
Tests: snapshot on Craggy in editor
Update: further filtering of methods
- Dropping BaseEntity.Is* methods that are just HasFlag wrappers
- Dropping new Rust.Data BufferStream and RangeHandle
Should reduce overhead on serialization
Tests: snapshot on Craggy in editor
Merge: from main
Tests: none, no conflicts
Merge: from relationshipmanager_leaks
- Server and Client-side bugfixes for pooling around RelationshipManager types
Tests: local 2 player session with flicking open-closed the contacts screen and with pooling tracking
Merge: from main
Tests: none, no conflicts
Bugfix: return ProtoBuf.PlayerRelationships back to pool after client rpc is executed
Think it was the only PlayerRelationships leak on client
Tests: local session on craggy, opened&closed contacts - saw pool metrics stay stable
Update: using new RelationshipManager.ClearRelations to avoid potential pooling leaks
Tests: none
Bugfix: clear PlayerRelationshipInfo when returning PlayerRelationship to pool
Tests: none, since it turns out that we don't have any code that stresses this path - one more thing to fix then
Bugfix: return PlayerRelationshipInfo back to pool when forgetting a player
2 more places to fix
Tests: none
Bugfix: return to pool ProtoBuf.RelationshipManager.PlayerRelationships + nested types after client rpcs
There's still one more server leak and a client leak
Tests: local 2-player session. Made sure changed code is being stepped through.
Merge: from main
Tests: none, no conflicts
Merge: from reduce_appmarkersellorder_allocs
- Reduces pool spillage and misses of ProtoBuf.AppMarker.SellOrder
Tests: started server on procgen map
Optim: Increase ProtoBuf.AppMarker.SellOrder pool capacity to 2k
- Should reduce creation and spillage of SellOrders
Tests: booted server on procgen.
Merge: from profiling_improvements
Tests: snapshot on craggy in editor
Merge: from main
Tests: none, no conflicts
Update: Further removal of about 10% methods from perf snapshot
- Built using e70c083b
Tests: took a snapshot on craggy
Merge: from listcompare_optim
- ListHashSet can now be pooled and supports Compare
- Optim Networkable.UpdateSubscriptions via ListHashSet
Tests: unit tests
Merge: from main
Tests: none, no conflicts
Clean: simplify code via ?. notation
Tests: unit tests
Optim: Constain List<T>.Compare to only works on List<T>
This removes remaining 4 boxing allocations
Tests: unit tests
Optim: Use ListHashSet<T>.Compare in UpdateSubscriptions and UpdateHighPrioritySubscriptions
Tests: none, trivial change
Update: Network.Visibility.Provider works on ListHashSet
Tests: none, simple changes
Update: Facepunch.Pool now supports ListHashSet
- gave ListHashSet a default ctor
Tests: unit tests
Update: ListHashSet has it's own specialized static Compare method
- Replciated tests from ListExtensionTests for ListHashSet
Tests: ran unit tests
Optim: List.Compare now uses pooled hashsets instead of hashing-and-sorting
2x faster. Now, just need to see if I can get rid of these remaining allocs (just 4 per stable run)
Tests: unit tests
Merge: from profiling_improvements
- Reduce capture size by ~19% by filtering out more methods
Tests: snapshot on craggy in editor
Update: further reduce capture scope by ~19%
- Built from c4679e41
Tests: snapshot in editor on Craggy
Merge: from parallel_validatemove
- Bugfix: GamePhysics.OverlapCapsules no longer skips 0-length-capsule queries
- Additional unit tests
Tests: unit tests + staging demo playback
Tests: add GamePhysics.CheckShhere, CheckCapsule and related consistency tests
Contains divergence cases that are constantly warned about - this is to document current behavior
Tests: ran unit tests
Update: Adding GamePhysics.CheckSpheres
Tests: unit tests (next submit)
Merge: from main
Tests: none, no conflicts
Update: Made GamePhysics.CheckCapsules and related consistent with CheckCapsule around sphere queries
- Added a defaulted param(true) that controls whether we should scan for sphere-like capsule queries or not
- Added a couple comments to clarify things
This adds ~1ms on 10k player perf test scenario, but should silence Unity's warnings
Tests: unit tests + staging demo playback
Update: GamePhysics.OverlapCapsules and OverlapSpheres now check for invalid commands and report errros
Tests: unit tests
Clean: added a comment expanding the reason for previous test
Tests: none, trivial change
▉▅▄█▆: ▊▌▋▉█▊▇▇▄▌▋▅▄▄▇▍▆▍▍▉█▊▆▆▅▇▆▉▉▋▆▅ - ▆▌▄▍ ▅▉▌▅ ▇▄▋▅▆▄▉▇▊ ▇-▇▆▅▌▌▄ ▉█▇▅▇▌▌ ▇▉▉▌▅
▍▇▌▊▄ ▋▅█▍ ▄▄▅▌▍▌▅█▄ ▄█ ▍▄█▊ ▅ ▋▌▉▆█▊▊▅▇ ▇▆▉ ▊▆█▋ █▅▉▇ ▆▆█▍ ▊▌▉ ▉█▅▍ ▍▅ █▆▍ ▊▅
▉▇▇▍█: ▉▊▉ ▋▌▊ ▋▉▌▌▇
Bugfix: ServerDemoPlayer - skip trying to spawn invalid prefabs from the server demo stream
Tests: played back server demo
Update: make ServerDemoPlayer complient with recent Protobuf changes
Tests: played back a staging server demo
Merge: from main
Tests: none, no conflicts