ModernUO/Projects/Server.Tests/Tests/Serialization
Kamron Batman 9780fc6634
perf(saves): keep the fallback push loop branch-free
Measured (10M entities through the real chunk source, both monomorphic and
16-subclass polymorphic populations): a bare `foreach { PushToCache(entity); }`
runs at 2.3ns/entity while the same loop carrying the heavy-entity check
(interface SerializedLength read + branch) runs at 5.3-5.7ns - 2.3x slower.
Type diversity barely matters; the cost is the fatter loop body, confirming
that per-entity logic in the push loop defeats the JIT's tight-loop codegen.

Entities over 1MB are rare in practice - realistically only whole
GenericPersistence self-payloads, which are already published as dedicated
single chunks - so the fallback loop drops the check and rare thick entities
ride inside shared chunks (bounded tail, same behavior as the slot-range fast
path). The now-unused HeavyEntityThreshold constant is removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 22:38:47 -07:00
..
BufferWriterTests.cs perf(saves): 2.2x faster BufferWriter write path, single-pass short strings 2026-07-16 22:38:46 -07:00
DecimalSerializationTests.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
EnumConversionTests.cs fix: Fixes spawner timer deserialization, decimal deserialization, and adds potion keg reverse lookup (#1711) 2024-03-28 13:34:12 -07:00
SerializationChunkSourceTests.cs perf(saves): keep the fallback push loop branch-free 2026-07-16 22:38:47 -07:00
ShadowDictionaryEntriesTests.cs perf(saves): workers iterate entity dictionaries directly; main thread joins the drain 2026-07-16 22:38:46 -07:00
TypeConverterTests.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00