GithubHelp home page GithubHelp logo

Non-blocking IO about libflate HOT 3 CLOSED

sile avatar sile commented on September 20, 2024
Non-blocking IO

from libflate.

Comments (3)

seanmonstar avatar seanmonstar commented on September 20, 2024 1

Thanks! I'll try it out in async reqwest.

from libflate.

sile avatar sile commented on September 20, 2024

Thanks for using libflate.
Supporting non-blocking I/O is an interesting feature, so I would like to make libflate can handle it.


A solution would be to create the Decoder immediately, and keep an internal buffer, and an state enum.

I think that this solution will work, but I'm concerned about the possibility that the performance may decline.
I am going to try implementing the feature in this (or the next) weekend and it's feedback will be written here.

from libflate.

sile avatar sile commented on September 20, 2024

At the version 0.1.9, I added the non_blocking module that includes decoders which support non-blocking I/O.

Below is a benchmark result:
(The non-blocking version decoder is somewhat inferior in performance to others)

$ cd libflate/flate_bench/
$ cargo run --release -- enwiki-latest-all-titles-in-ns0
# ENCODE (input_size=279095302)
- libflate: elapsed=5.496754s, size=96761378
-   flate2: elapsed=9.369781s, size=74692153

# DECODE (input_size=74692153)
-                libflate: elapsed=1.095406s, size=279095302
- libflate (non-blocking): elapsed=1.715038s, size=279095302
-                  flate2: elapsed=0.789984s, size=279095302
-                 inflate: elapsed=1.643498s, size=279095302

from libflate.

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.