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 fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
BoneKnight.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Brigand.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
ChaosDaemon.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Cursed.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Cyclops.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Doppleganger.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
ElfBrigand.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
EnslavedGargoyle.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Ettin.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Executioner.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
FrostTroll.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
GazerLarva.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Ghoul.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
GreaterMongbat.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
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 fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Juggernaut.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
KhaldunRevenant.cs feat: Adds new decay system and SkipSerialization (#2311) 2026-01-08 11:43:51 -08:00
KhaldunSummoner.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
KhaldunZealot.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Moloch.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Mongbat.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Mummy.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Ogre.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
OgreLord.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Orc.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
OrcBomber.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
OrcBrute.cs chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
OrcCaptain.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
OrcishLord.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Ratman.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
RatmanArcher.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
RestlessSoul.cs fix: Moves ContextMenu out of core, streamlines code, fixes bugs (#1873) 2024-07-20 21:33:23 -07:00
RottingCorpse.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Savage.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
SavageRider.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
ShadowFiend.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
SkeletalKnight.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Skeleton.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
SpawnedOrcishLord.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
SpectralArmour.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
StoneGargoyle.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
StrongMongbat.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Troll.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00
Zombie.cs fix: Changes on Mele Humanoid Monsters to use code generation (#1300) 2022-12-13 14:33:05 -08:00