Performance
- Speed up repeated cached permission lookups by name and ID without changing lookup semantics (#2969).
- Preserve loose comparisons, guard isolation, first-match ordering, shared model identity, and mutations of returned models. Custom models and keyed collections continue to use the original filter.
- Keep lookup indexes tied to cache invalidation, including saved changes, deletion, explicit resets, and cache/tenant reinitialization.
Verification
- Add regression coverage for numeric comparisons, custom accessors and keys, collection ordering, runtime casts, invalidation, strict missing-attribute handling, and release of cached model references.
- Add an opt-in benchmark covering warm hits/misses, hydration, and retained memory. Indexing trades some hydration work and memory for faster repeated lookups; performance depends on the workload and is not unconditionally O(1).
No breaking changes. Public APIs, persistent cache format, and PHP/Laravel support are unchanged.
Full Changelog: 8.3.1...8.3.2