Open TheDigitalOrchard opened 1 month ago
WeakMap like use object instance as key to array offset? In any case, this was a premature optimization. There wouldn't have been any considerable performance penalty from looking up the object in the request queue and removing it as soon as it was done.
You mention that cleanup is expensive. What if you used a built-in PHP approach, such as WeakMap array or one of the Ds containers?
WeakMap would set the minimum to PHP 8, but that's becoming standard now.