blaze-builder: Efficient buffered output.

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

This library allows to efficiently serialize Haskell values to lazy bytestrings with a large average chunk size. The large average chunk size allows to make good use of cache prefetching in later processing steps (e.g. compression) and reduces the system call overhead when writing the resulting lazy bytestring to a file or sending it over the network.

This library was inspired by the module Data.Binary.Builder provided by the binary package. It was originally developed with the specific needs of the blaze-html package in mind. Since then it has been restructured to serve as a drop-in replacement for Data.Binary.Builder, which it improves upon both in speed as well as expressivity.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.2.1.0, 0.2.1.1, 0.2.1.2, 0.2.1.3, 0.2.1.4, 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.3.1.0, 0.3.1.1, 0.3.2.0, 0.3.3.0, 0.3.3.1, 0.3.3.2, 0.3.3.3, 0.3.3.4, 0.4.0.0, 0.4.0.1, 0.4.0.2, 0.4.1.0, 0.4.2.1, 0.4.2.2, 0.4.2.3
Change log CHANGES
Dependencies base (>=4.3 && <5), bytestring (>=0.9 && <1), bytestring-builder, deepseq, ghc-prim, semigroups (>=0.16 && <0.20), text (>=0.10 && <3) [details]
Tested with ghc ==9.8.0, ghc ==9.6.2, ghc ==9.4.7, ghc ==9.2.8, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.8.4, ghc ==8.6.5, ghc ==8.4.4, ghc ==8.2.2, ghc ==8.0.2, ghc ==7.10.3, ghc ==7.8.4, ghc ==7.6.3, ghc ==7.4.2, ghc ==7.0.4
License BSD-3-Clause
Copyright (c) 2010-2014 Simon Meier (c) 2010 Jasper Van der Jeugt (c) 2013-2015 Leon P Smith
Author Jasper Van der Jeugt, Simon Meier, Leon P Smith
Maintainer https://github.com/blaze-builder
Category Data
Home page https://github.com/blaze-builder/blaze-builder
Bug tracker https://github.com/blaze-builder/blaze-builder/issues
Source repo head: git clone https://github.com/blaze-builder/blaze-builder.git
Uploaded by AndreasAbel at 2023-08-27T17:50:11Z
Distributions Arch:0.4.2.3, Debian:0.4.1.0, Fedora:0.4.2.2, FreeBSD:0.4.0.1, LTSHaskell:0.4.2.3, NixOS:0.4.2.3, Stackage:0.4.2.3, openSUSE:0.4.2.3
Reverse Dependencies 285 direct, 7830 indirect [details]
Downloads 346072 total (416 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-08-27 [all 1 reports]

Readme for blaze-builder-0.4.2.3

[back to package description]

Hackage version blaze-builder on Stackage Nightly Stackage LTS version Cabal build

blaze-builder

This library allows to efficiently serialize Haskell values to lazy bytestrings with a large average chunk size. The large average chunk size allows to make good use of cache prefetching in later processing steps (e.g. compression) and reduces the system call overhead when writing the resulting lazy bytestring to a file or sending it over the network.

This library was inspired by the module Data.Binary.Builder provided by the binary package. It was originally developed with the specific needs of the blaze-html package in mind. Since then it has been restructured to serve as a drop-in replacement for Data.Binary.Builder, which it improves upon both in speed as well as expressivity.

To see the improvements in speed, run the throughput benchmark, which measures serialization speeds for writing Word8, Word16, Word32 and Word64 in different endian formats and different chunk sizes, using the command

  make bench-throughput

or run the list serialization comparison benchmark

  make bench-blaze-vs-binary

Checkout the combinators in the module Blaze.ByteString.Builder.Write to see the improvements in expressivity. This module allows to incorporate efficient primitive buffer manipulations as parts of a builder. We use this facility in the blaze-html HTML templating library to allow for the efficient serialization of HTML escaped and UTF-8 encoded characters.