ModernUO/Projects/Server/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
..
Attributes fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
AdhocPersistence.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
BinaryFileReader.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
BufferReader.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
BufferWriter.cs perf(saves): 2.2x faster BufferWriter write path, single-pass short strings 2026-07-16 22:38:46 -07:00
GenericEntityPersistence.cs perf(saves): keep the fallback push loop branch-free 2026-07-16 22:38:47 -07:00
GenericPersistence.cs perf(saves): chunked worker handoff, LPT blob scheduling, heap pre-sizing 2026-07-16 22:38:46 -07:00
IGenericReader.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
IGenericSerializable.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
IGenericWriter.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
ISerializable.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
ISerializableExtensions.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
MemoryMapFileWriter.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
Persistence.cs perf(saves): chunked worker handoff, LPT blob scheduling, heap pre-sizing 2026-07-16 22:38:46 -07:00
SerializationChunkSource.cs perf(saves): keep the fallback push loop branch-free 2026-07-16 22:38:47 -07:00
SerializationExtensions.cs feat: Refactor Poison system, implement Darkglow & Parasitic effects (#2385) 2026-03-21 21:27:22 -07:00
SerializationThreadWorker.cs perf(saves): workers iterate entity dictionaries directly; main thread joins the drain 2026-07-16 22:38:46 -07:00
ShadowDictionaryEntries.cs perf(saves): workers iterate entity dictionaries directly; main thread joins the drain 2026-07-16 22:38:46 -07:00
UnmanagedDataReader.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00