Giter VIP home page Giter VIP logo

Comments (8)

valyala avatar valyala commented on July 25, 2024

@sschepens , could you confirm that fasthttp now properly handles Content-Encoding: deflate?

from fasthttp.

valyala avatar valyala commented on July 25, 2024

As for @klauspost 's compress library, I'll look into it later.

from fasthttp.

klauspost avatar klauspost commented on July 25, 2024

AFAIR there are different opinions on what deflate means, which is why Content-Encoding: gzip is generally preferred.

Found a some information from Mark Adler:

[]...
However early Microsoft servers would incorrectly deliver raw deflate for "Deflate" (i.e. just RFC 1951 data without the zlib RFC 1950 wrapper). This caused problems, browsers had to try it both ways, and in the end it was simply more reliable to only use gzip.

The impact in bandwidth and execution time to use gzip instead of "Deflate" (zlib), is relatively small. So there we are and there it is likely to remain.

The difference is 12 more bytes for gzip and slightly more CPU time to calculate a CRC instead of an Adler-32.

CRC will actually be faster on AMD64, since there are assembler optimized routines (if you use my compression package), so the last point isn't valid for Go.

from fasthttp.

sschepens avatar sschepens commented on July 25, 2024

@klauspost I know gzip is usually preferred over deflate, but I use some services that only support deflate. I believe nowadays it's more common to have deflate as zlib than raw deflate, and according to standard should be zlib.

from fasthttp.

valyala avatar valyala commented on July 25, 2024

@klauspost , are there chances for the integration of your compression performance improvements into standard Go library?

from fasthttp.

klauspost avatar klauspost commented on July 25, 2024

@valyala - yes, I have just begun submitting the CLs, but it will of course not be out until 1.7.

Meanwhile, it can easily be integrated. There should be nothing more than an import change to use the current code, which is roughly 1.7x faster than the built-in, with no allocations if the Encoder is reused - which you appear to already do.

from fasthttp.

valyala avatar valyala commented on July 25, 2024

Substituted standard compress library with https://github.com/klauspost/compress

from fasthttp.

sschepens avatar sschepens commented on July 25, 2024

👍

from fasthttp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.