brotli_neo 0.2.0
brotli_neo: ^0.2.0 copied to clipboard
Pure Dart Brotli (RFC 7932) encoder and decoder with zero-copy bytes and web support.
0.2.0 #
- Breaking: new performance-first raw API in
package:brotli_neo/v2.dart(BrotliEncoderV2/BrotliDecoderV2, one-shot and*Intobuffer variants). The v0.1 blit-native andcompat.dartAPIs remain available for migration. - Upgrade to
blit0.2.1. File I/O now uses theBlit/BlitFilefacade (FileOptions,readAt/write), and the blit-native encode/decode functions route through the v2 core. - Add zero-copy
BrotliEncoderV2.encodeBytes/BrotliDecoderV2.decodeBytesforBytesLikeinputs andBytesoutputs. - VM/AOT/dart2wasm use 64-bit bit accumulators, wide copy and the fused
metablock decoder; dart2js uses the correct 32-bit fallback
(
dart.library.js_utildistinguishes the two Web compilers). A 1 MiB q5 WASM binary decode now runs at ~846 MB/s instead of failing the fused loop. - CI benchmarks JIT/AOT/JS through
benchmark_testand runs a dedicatedtool/v2_wasm_bench.dartfor WASM; the old benchmark_test Node wasm driver crashed in its test framework. UnsafeByteswas evaluated for the hot path but is slower thanUint8List(and less portable), so the codec keeps typed-array buffers; blit participates at the I/O/API boundary instead.- AOT 1 MiB q5 benchmark card: decode text ~1.74 GB/s / binary ~1.11 GB/s; encode text ~244 MB/s / binary ~168 MB/s. Relative to the Rust oracle this is roughly 158%/215% decode and 138%/140% encode on this machine.
- Hybrid quality routing: q0/q1 use the faster legacy greedy path on text and a binary-tuned greedy tier on binary; q2–q5 use the v2 fast path; q6+ keeps the quality tiers. Legacy is byte-identical for delegated qualities.
- Web 1 MiB decode underflow fixed by disabling the 64-bit-only fused loop on dart2js and using the generic resumable path.
- Benchmark card now exercises the v2 API; native comparison and the
tool/v2_bench.dartgate are part of the repository.
0.1.2 #
- Serialized shared dictionaries are decoded
(
BrotliDecodeOptions.sharedDictionary): magic/prefix chunks, custom word lists, custom transform lists (prefix/type/suffix, SHIFT parameters, identity cutoff), 64-context dictionary maps, multi-dictionary fallback and the embedded LZ77 prefix. Invalid dictionaries raiseBrotliException. - Q11 performance: 1 MiB text 2.24 s -> ~1.2 s and q10 1.13 s -> ~0.98 s, at <=0.13% size cost, by caching/propagating matches between the two optimal parse passes and narrowing the search.
0.1.1 #
- Q10/Q11 now run a bounded shortest-path (Zopfli-style) optimal parse: strict gains over Q9 on English text (1 MiB 50,939 -> 50,588 -> 50,486), CJK 152,473 -> 138,418 (-9.2%), and improved ratios versus the Rust oracle.
- Prepared compound dictionaries:
BrotliPreparedDictionarybuilds the dictionary index once and can be shared by many one-shot or streaming encodes viaBrotliEncodeOptions.preparedDictionary; output is byte-identical to the rawcompoundDictionarypath. - Benchmark card rendering migrated to
benchcat, with a linear bar curve and the OFL font underassets/fonts/. - CI: the Rust oracle is built and used by the platform matrix; the RFC corpus
and dictionary fixtures are stored with exact bytes (
-text); all test jobs gate the benchmark and chart commit.
0.1.0 #
- Pure Dart Brotli decoder (RFC 7932): static dictionary, 121 transforms, context modeling, large-window decode, streaming and one-shot APIs.
- Encoder quality 0–11: hash chains, lazy matching, 1/2/3 and 13-context literal models, block splitting, distance-parameter search, RLE-optimized histograms, static-dictionary references, large-window encoding and a cost-guided parser for the highest qualities.
- Push-style streaming encoder (
BrotliEncoder) and decoder, includingflush/finishsemantics and incremental output. - Compound dictionary encode + decode (
BrotliEncodeOptions.compoundDictionary/BrotliDecodeOptions.compoundDictionary), interoperable with Rust--dictionarystreams in both directions. - The serialized shared/prepared dictionary format remains the only unimplemented extension.
- Blit-native API (
Bytes/BytesLike/BytesMut) plus acompat.dartUint8List/List<int>API,dart:convertcodec and file helpers. - Web-safe: VM, dart2js and dart2wasm; no
dart:ioin the codec. - 22/22 reference corpus pairs decode byte-exactly; deterministic fuzz and
round-trip tests; Rust
brotlioracle comparisons. - Four-row benchmark (decode/encode, 1 MiB text/binary, q5) against JIT/AOT/JS/ WASM and the Rust oracle; one CI workflow from tests to benchmark charts.
- Not included in 0.1.0: the serialized shared/prepared dictionary format (planned for 0.1.1).