ModernUO/Projects/UOContent/Mobiles/Monsters/Humanoid/Melee
Kamron Batman ee2cd1d18d
feat: Adds new decay system and SkipSerialization (#2311)
## Summary

- Replaces scan-based decay checking during world saves with an event-driven timer wheel scheduler
- Removes virtual property checks from serialization hot path, achieving 6-8x faster world saves

## Changes

### DecayScheduler (new):
- Timer wheel with 12 HashSet buckets (5-min intervals) + PriorityQueue for active processing
- O(1) register/unregister vs O(n) scan of all items
- Auto start/stop when items exist/empty
- Configurable tick interval with jitter to prevent system synchronization

### Item.cs:
- Added ScheduledDecayTime computed property
- Added UpdateDecayRegistration() called from SetLastMoved(), property setters, AddItem()/RemoveItem()
- Hooks in Visible, Movable, Spawner setters and Delete()

### World.cs:
- Removed _decayQueue, EnqueueForDecay(), ProcessDecay()
- ItemPersistence.Serialize() now tight loop without virtual calls

## Performance

| Metric        | Before     | After     | Improvement |
|---------------|------------|-----------|-------------|
| Items (230K)  | 245K ticks | 34K ticks | 8x faster   |
| Mobiles (43K) | 56K ticks  | 6K ticks  | 9x faster   |
| Total         | 302K ticks | 40K ticks | 7.5x faster |

## Configuration

decay.maxItemsPerTick = 250       # Items processed per tick
decay.tickInterval = 256ms        # Base processing interval
decay.bucketInterval = 5min       # Timer wheel bucket size
decay.jitterMaxMs = 25            # ±25ms tick jitter
2026-01-08 11:43:51 -08:00
..
ArcticOgreLord.cs
BoneKnight.cs
Brigand.cs
ChaosDaemon.cs
Cursed.cs
Cyclops.cs
Doppleganger.cs
ElfBrigand.cs
EnslavedGargoyle.cs
Ettin.cs
Executioner.cs
FrostTroll.cs
GazerLarva.cs
Ghoul.cs
GreaterMongbat.cs
Guardian.cs fix: Changes BaseWeapon to source generator and changes crafter to string (#1519) 2023-09-29 22:45:37 -07:00
HeadlessOne.cs fix: Adds body parts to headless one loot (#2225) 2025-07-07 18:54:18 -07:00
HordeMinion.cs
Juggernaut.cs
KhaldunRevenant.cs feat: Adds new decay system and SkipSerialization (#2311) 2026-01-08 11:43:51 -08:00
KhaldunSummoner.cs
KhaldunZealot.cs
Moloch.cs
Mongbat.cs
Mummy.cs
Ogre.cs
OgreLord.cs
Orc.cs
OrcBomber.cs
OrcBrute.cs chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
OrcCaptain.cs
OrcishLord.cs
Ratman.cs
RatmanArcher.cs
RestlessSoul.cs fix: Moves ContextMenu out of core, streamlines code, fixes bugs (#1873) 2024-07-20 21:33:23 -07:00
RottingCorpse.cs
Savage.cs
SavageRider.cs
ShadowFiend.cs
SkeletalKnight.cs
Skeleton.cs
SpawnedOrcishLord.cs
SpectralArmour.cs
StoneGargoyle.cs
StrongMongbat.cs
Troll.cs
Zombie.cs