Comments (6)
@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.
Will look into that.
from erl-brotli.
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.
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.
@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.
Awesome, thanks @hauleth for the quick fix & update.
from erl-brotli.
Related Issues (8)
- Feature request: add a "flush()" API
- module :brotli_nif is not available HOT 17
- brotli.so not copied to build dir on elixir 1.13
- brotli/port.h error in Erlang/OTP 26 HOT 3
- Name of compiled .so file depends on name of project directory
- How to change compression level? HOT 2
- Maintenance of the project HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from erl-brotli.