Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressor cache #7

Merged
merged 5 commits into from
Mar 18, 2023
Merged

Compressor cache #7

merged 5 commits into from
Mar 18, 2023

Conversation

dktapps
Copy link
Member

@dktapps dktapps commented Mar 18, 2023

As it turns out, allocating compressors is surprisingly expensive, and it makes up a significant portion of the runtime at lower compression levels.

This PR caches allocated compressors in request globals, which allows them to be reused by the thread they were allocated in, reducing the amount of work required.

this improves performance, especially at low compression levels.

this also allocates the compressors using emalloc, which is faster. Since compressors can't be shared between threads anyway, this also ensures that a memory error will be recorded by Zend if anything sus happens.
@dktapps dktapps merged commit 0642334 into master Mar 18, 2023
@dktapps dktapps deleted the compressor-cache branch March 18, 2023 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant