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

Very slow compression performance #50

Open
StarpTech opened this issue Jul 26, 2024 · 5 comments
Open

Very slow compression performance #50

StarpTech opened this issue Jul 26, 2024 · 5 comments

Comments

@StarpTech
Copy link

StarpTech commented Jul 26, 2024

Hi, I use the module to compress 3MB HTML and Javascript. The response takes seconds ~1.8s. The variant without the brotli middleware takes ~20ms

Compression level: 6 (Default)

Machine: Mac M3 Max

@andybalholm
Copy link
Owner

How does the speed change if you adjust the compression level?

@StarpTech
Copy link
Author

Even with 0 still significant.

@andybalholm
Copy link
Owner

It sounds like the issue is something other than the brotli compression itself. What brotli middleware are you using?

@andybalholm
Copy link
Owner

I don't know anything about that middleware, but you could try an encoder function that just returns w instead of creating a brotli Writer. The response won't be readable, but the performance will tell you whether the brotli encoding has anything to do with your performance issue…

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

No branches or pull requests

2 participants