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

the CompressionAlgo::BR algo is very, very slow > 11s #794

Open
rxdiscovery opened this issue Apr 3, 2024 · 2 comments
Open

the CompressionAlgo::BR algo is very, very slow > 11s #794

rxdiscovery opened this issue Apr 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rxdiscovery
Copy link

rxdiscovery commented Apr 3, 2024

Hello,

When the browser requests compression with Brotli, the algo used by poem is very slow to generate the compression, taking 11s just to compress the swagger UI page.

it's this algo that's causing the problem : CompressionAlgo::BR

fn custom_compress() -> Compression {
    let algorithms = vec![CompressionAlgo::BR]; // <- ------------ !!!!!!!!!!!!!!!!!!!!!!!
    Compression::new()
        .algorithms(algorithms)
        .with_quality(poem::web::CompressionLevel::Best)
}

especially with one of the compression levels :
poem::web::CompressionLevel::Default or poem::web::CompressionLevel::Best

with other algo's there is no slowness, it's instantaneous :

    let algorithms = vec![CompressionAlgo::DEFLATE,CompressionAlgo::GZIP];

(Poem version : 3.0.0)

@rxdiscovery rxdiscovery added the bug Something isn't working label Apr 3, 2024
@sunli829
Copy link
Collaborator

It's really slow, the problem might be with async-compression, I'm not sure.

@rxdiscovery
Copy link
Author

rxdiscovery commented May 14, 2024

@sunli829 try upgrading to the new version "v0.4.10" , maybe this will solve the problem ?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants