whitequark / ocaml-lz4 Goto Github PK
View Code? Open in Web Editor NEWOCaml bindings for LZ4, a very fast lossless compression algorithm
License: BSD 3-Clause "New" or "Revised" License
OCaml bindings for LZ4, a very fast lossless compression algorithm
License: BSD 3-Clause "New" or "Revised" License
trying decompress with larger and larger ~length parameter to hold the output until it succeeds doesn't look very smart.
You already have a compress_bound, so I wonder if it is possible.
I don't know if this is maintained anymore, but I'll try anyway.
let lines = load_big_file file in
Printf.printf "%S\n" (string_of_int (Bigarray.Array1.dim lines));
let compressed_content = LZ4.Bigbytes.compress(lines) in
Printf.printf "%S\n" (string_of_int (Bigarray.Array1.dim compressed_content));
write compressed_content "file.ext";
Gives me:
"523283080"
"524743149"
I assume I did something wrong, as there is no such issue reported here. I pass a Bigarray to the compression function. I tested several files, yet not a single one decreases in size.
instead of asking for a length parameter and allocating a fresh buffer each time
(And support latest OCaml 4.07 too)
cf.
https://travis-ci.org/github/ocaml/opam-repository/jobs/713590305
#=== ERROR while compiling lz4.1.1.1 ==========================================#
# context 2.0.6 | freebsd/x86_64 | ocaml-base-compiler.4.09.1 | file:///usr/home/travis/build/ocaml/opam-repository
# path /usr/home/travis/.opam/ocaml-base-compiler.4.09.1/.opam-switch/build/lz4.1.1.1
# command /usr/home/travis/.opam/ocaml-base-compiler.4.09.1/bin/ocaml setup.ml -build
# exit-code 1
# env-file /usr/home/travis/.opam/log/lz4-8809-f44153.env
# output-file /usr/home/travis/.opam/log/lz4-8809-f44153.out
### output ###
# [...]
# + /usr/home/travis/.opam/ocaml-base-compiler.4.09.1/bin/ocamlopt.opt unix.cmxa -I /usr/home/travis/.opam/ocaml-base-compiler.4.09.1/lib/ocamlbuild /usr/home/travis/.opam/ocaml-base-compiler.4.09.1/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/home/travis/.opam/ocaml-base-compiler.4.09.1/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# File "myocamlbuild.ml", line 518, characters 43-62:
# 518 | List.map (fun m -> (String.uncapitalize m) ^ ".cmi")
# ^^^^^^^^^^^^^^^^^^^
# Alert deprecated: Ocamlbuild_plugin.String.uncapitalize
# Use String.uncapitalize_ascii instead.
# File "myocamlbuild.ml", line 531, characters 51-70:
# 531 | List.map (fun m -> dir^"/"^(String.uncapitalize m)^".cmi")
# ^^^^^^^^^^^^^^^^^^^
# Alert deprecated: Ocamlbuild_plugin.String.uncapitalize
# Use String.uncapitalize_ascii instead.
# E: Failure("Command ''/usr/home/travis/.opam/ocaml-base-compiler.4.09.1/bin/ocamlbuild' lib_gen/LZ4_bindgen.byte lib/liblz4_stubs.a lib/dlllz4_stubs.so lib/lz4.cma lib/lz4.cmxa lib/lz4.a lib/lz4.cmxs -tag debug' terminated with error code 10")
this is bad for performance (you always allocate). Users should be allowed to pass a buffer, with an offset in it and a maximum size to use in it.
I tried building the library on a NetBSD system (which uses PKGSRC for its 3rd-party package installer.) All packages installed by this manager are placed in /usr/pkg/*
. The build fails because it can't find lz4.h
(since it's not looking in /usr/pkg/include
.) The build would also have to find and specify the library in /usr/pkg/lib
.
How do we add a search path? I didn't see a config-lz4
in OPAM.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.