Coder Social home page Coder Social logo

Comments (6)

hauleth avatar hauleth commented on August 15, 2024 1

@marmor157 another reason why I prefer using Erlang implementation for compressing via brotli:encode/{1,2} is that it create less stress on the schedulers (even dirty). Having NIF that will run few seconds can be problematic even with dirty schedulers.

from erl-brotli.

hauleth avatar hauleth commented on August 15, 2024

Will look into that.

from erl-brotli.

hauleth avatar hauleth commented on August 15, 2024

I think that the problem is different - brotli:encode/1 can be used with binaries that are at most 1.25 MiB (that is 1310721 bytes). Question is how we should handle such case. Whether disallow passing such huge binaries at once and force user to use streaming parsing, or rather "internally" split the input into smaller chunks and parse them separately.

from erl-brotli.

marmor157 avatar marmor157 commented on August 15, 2024

For brotli:encode/1 I would suggest using BrotliEncoderCompress as it performs one-shot memory-to-memory compression, and is essentialy what brotli:encode/1 is now, but also add brotli:encode_stream which would internally use BrotliEncoderCompressStream and would allow to handle output in chunks. But to do that there would have to be a way to handleavailable_in, next_in, next_out and total_out which are used to resume compression

from erl-brotli.

hauleth avatar hauleth commented on August 15, 2024

@marmor157 the problem is that BrotliEncoderCompress supports only small set of the options that brotli:encode/2 supports. Technically I could do some runtime checks to pick proper implementation, however that was easier.

from erl-brotli.

bblaszkow06 avatar bblaszkow06 commented on August 15, 2024

Awesome, thanks @hauleth for the quick fix & update.

from erl-brotli.

Related Issues (8)

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.