![]() |
|
[Plugin] IndexWeaver - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13) ---- Forum: Plugins (https://forum.open.mp/forumdisplay.php?fid=32) ---- Thread: [Plugin] IndexWeaver (/showthread.php?tid=4321) |
IndexWeaver - itskoleban - 2026-07-14 IndexWeaver A high-performance, lightweight in-memory ID-to-index registry plugin designed specifically for open.mp. - The Problem How many times have you written a linear `for` loop across `MAX_PLAYERS` or `MAX_VEHICLES` just to find the array slot that matches a specific SQL Database ID or an arbitrary key? Linear loops `O(N)` are slow and unnecessary. - The Solution IndexWeaver completely eliminates these linear searches. It maps your primary keys (like SQL IDs) directly to your Pawn array slots, allowing your Pawn code to remain the single source of truth for the actual data, while giving you instantaneous O(1) memory lookups. - Architecture & Performance IndexWeaver implements a heavily optimized Hybrid Storage Model:
- Pawn API Code: native bool:SetMapIndex(registry_type, id, index);- Quick Example Instead of looping through all loaded clans to find the one with `SQL_ID == 850`: Code: // Store the index when loading from the database- Download & Source Code The plugin is entirely open-source, beautifully documented, and cross-platform (Windows/Linux).
Contributions and Pull Requests are welcome! |