branchrust_reboot/main/pool_mtcancel
17 Commits over 30 Days - 0.02cph!
Merge: from fuzzy_circularbuffer
Chosing this implementation
Update(tests): add a couple tests
- Perf: AllocDeallocMPSCAtomicCounter
- Unit: TestAllocWhenEmpty, TestFreeWhenFull
Tests: ran tests
Update(tests): add 4, 8, 16, 32 task scenarios (previously was just 32) for pool perf tests
Tests: ran perf tests
Update(tests): expand AllocDeallocMTShortLived to optionally simulate busywork
We're never going to be just slamming the pool(or if we do - we shouldn't as that's overhead). This makes the test closer to real world.
Tests: ran perf test
Clean(tests): consolidate pool create-spilled code into Utils.MeasureAndPrint
Tests: ran perf tests
Cherrypick from pool_mt/circularbuffer - test improvements
Update(tests): add a couple more perf tests
- AllocDeallocMT -> AllocDeallocMTLongLived (biases Get, then Free operations), Avg: 3.56901ms
- AllocDeallocMTShortLived - fetches and returns to pool immediately (to evenly spread pressure), Avg: 3.01974ms
- AllocDeallocMPSC - simulates multiple-producers-single-consumer (emulates network write thread under jobs 2) Avg: 12.20773ms
All cases - 32 tasks doing 1k allocs
Tests: ran perf tests
Update(tests): AllocDeallocMT perf test scope annotations
Tests: ran perf test
Bugfix: ensure Pool.Fill keeps items in use valid
Tests: ran unit tests
Optim: rewrite Pool to use ConcurrentBag(many mutexes) instead of single mutex
Fails unit tests, but not going to focus on fixing it just yet - want to make it faster first.
ST avg: 0.88781ms
MT avg: 3.1281ms
Tests: ran perf tests
Update(tests): add TestMTPressure unit test
Wrote it cause my ConcurrentBag based pool is misbehaving
Tests: ran new unit test
Update(tests): pool now has a runtime switch to disable editor-only safety logic, so that perf is more apples-to-apples
ST avg: 1.0358ms
MT avg: 13.6264ms
Tests: ran perf tests
Update(tests): add simple pool perf tests (ST & MT)
ST avg: 1.29925ms for 10k alloc-deallocs
MT avg: 21.16116ms for 1k alloc-deallocs per task, 32 tasks
Tests: ran tests
Update: move Utils Measure routines to Facepunch.System.Tests
- also make it auto-referenced
Tests: compiles