ModernUO/Projects/UOContent.Tests/Tests
Kamron Batman a5c785c4a0
perf: stop the auto-denylist re-sweeping for every rejected address
At the cap, Hold() swept the whole dictionary before rejecting each new
distinct address. Entries are held 15 minutes, so during a sustained
distinct-source flood -- the case the cap exists for -- almost every one
of those sweeps freed nothing and the next address swept again. _warnedFull
suppressed the log, not the work.

Measured on the same loop shape (Dictionary<UInt128,long>, iterate, Remove
in place, Release, best of 20):

     entries   0% lapsed   50%      100%
       1,024     0.001ms   0.003    0.005
       8,192     0.006ms   0.060    0.095
      65,536     0.112ms   0.735    1.053
     262,144     0.558ms   4.116    5.233

At the shipped 65,536 cap that is 0.11ms per rejected address: 11ms/sec of
wasted loop at 100 new addresses/sec, 110ms/sec at 1000. The bound became a
cost multiplier under exactly the load it bounds.

A sweep that just ran cannot have freed more, so cap-triggered sweeps are
now throttled to one a second, taking the worst case to 0.11ms/sec. The
periodic sweep is untouched and was never the problem: bounded by the cap,
allocation-free, early-outs when empty, ~1ms once a minute at worst.

Also holds and stops the sweep timer. AutoDenylistFilter.Start registered a
recurring tokenless Timer.DelayCall while Stop() was empty, so a Stop/Start
cycle left the old sweep running and added another -- the same bug just
fixed in BlocklistFilter.

The new test fails without the throttle (5 sweeps instead of 1), verified
by disabling it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 21:42:33 -07:00
..
Accounting perf(login): run password hashing on a parked worker thread (#2566) 2026-08-09 00:13:34 -07:00
Engines fix(opl): refuse property list invalidation raised from inside GetProperties (#2555) 2026-07-28 21:29:03 -07:00
Gumps fix: Warn when sending empty gumps (#2563) 2026-08-08 00:55:12 -07:00
Items fix: Stop treasure chest guardian spawn farming via stack splits (#2568) 2026-08-10 09:01:29 -07:00
Misc chore: Fixes name verification test (#2201) 2025-05-26 22:36:23 -07:00
Mobiles/AI fix(ci): run test projects on CI; remove brittle OPL attribute tests (#2513) 2026-07-02 22:35:37 -07:00
Multis fix(housing): register doors, and stop crashing on client component sheets (#2557) 2026-08-04 20:05:28 -07:00
Network perf: stop the auto-denylist re-sweeping for every rejected address 2026-08-13 21:42:33 -07:00
Skills feat: Implements passive Detect Hidden mechanics (#2342) 2026-02-28 11:24:49 -08:00
Spells fix(necromancy): correct Blood Oath duration, reflection, and expiry timing (#1690) (#2480) 2026-06-08 23:42:28 -07:00
Utilities fix: Harden Advanced Search: crash-safety, autosave, correct results & worker fixes (#2543) 2026-07-21 07:51:06 -07:00
WorldSaves feat: Implements new robust/pluggable backup/archive system. (#2388) 2026-03-22 19:51:20 -07:00