inflate: thread-local libdeflate with gnu ABI — 2.2x speedup, 100% coverage

Root cause of crashes was thread safety: libdeflate's decompressor struct
has mutable decode tables rebuilt per-block, so sharing between main thread
and FMOD audio thread caused wild writes. Fixed with a thread-local pool
keyed by Windows thread ID (FS:[0x24]).

Switched build ABI from msvc to gnu — eliminates stub headers, libdeflate
uses Zig's bundled MinGW libc. Relaxed zlib header filter from == 0x78 to
(CMF & 0x0F) == 0x08 to catch both 32K and 4K window sizes.

Benchmarked: stock=2681ms, per-call-alloc=1304ms (2.05x), tls=1194ms (2.2x)
on 84k calls. Zero errors, zero fallbacks in production.
This commit is contained in:
MarcelineVQ
2026-03-24 14:57:28 -07:00
parent b612e6f953
commit 80a7cdea3f
4 changed files with 140 additions and 267 deletions
+21
View File
@@ -193,6 +193,21 @@ end)
local name, rank, icon, castTime, minRange, maxRange, spellId = GetSpellInfo(133)
```
- `UnitCastingInfo("unit")` -- TBC/WotLK cast bar query (works on any visible unit):
```lua
local name, rank, text, icon, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo("target")
if name then
-- startTime/endTime are in milliseconds (compare with GetTime()*1000)
end
```
- `UnitChannelInfo("unit")` -- TBC/WotLK channel bar query:
```lua
local name, rank, text, icon, startTime, endTime, isTradeSkill, notInterruptible = UnitChannelInfo("target")
```
See the [DPSLog wiki page](https://codeberg.org/gwenael/WeirdUtils/wiki/DPSLog) for full event reference and addon developer guide.
**DLL:** `dpslog.dll`
@@ -239,6 +254,12 @@ No configuration needed. Enabled by default when using `weirdutils.dll`.
---
### Performance
Replaces 20+ internal math functions with SIMD (SSE/AVX) equivalents and swaps the game's 2004-era zlib with a modern decompression library (2.2x faster). Covers skeletal animation, particle rendering, frustum culling, collision detection, text glyph caching, and float-to-integer conversion. Most noticeable in cities, raids, and during zone transitions. No visual difference, no configuration needed. Included in `weirdutils.dll`.
---
### Timer Calibration
Improves the game's internal timer precision by recalibrating the TSC (Time Stamp Counter) frequency using the OS performance counter as a reference. The vanilla client's built-in calibration is inaccurate, which can cause animation stutter and timing jitter on some systems.