| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Date: Sun, 18 Jan 2026 01:25:23 GMT
Age: 0
X-Served-By: cache-dfw-kdfw8210053-DFW, cache-bom-vanm7210030-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768699523.432354,VS0,VE300
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
superbuffer: Efficiently build a bytestring from smaller chunks
[Skip to Readme]
superbuffer: Efficiently build a bytestring from smaller chunks
Efficiently (both fast and memory efficient) build a bytestring from smaller chunks
[Skip to Readme]
Modules
[Index] [Quick Jump]
Downloads
- superbuffer-0.3.1.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.3.1.0, 0.3.1.1, 0.3.1.2 |
|---|---|
| Dependencies | base (>=4.8 && <5), bytestring (<0.12) [details] |
| License | BSD-3-Clause |
| Copyright | 2016 - 2022 Alexander Thiemann <mail@athiemann.net> |
| Author | Alexander Thiemann |
| Maintainer | mail@athiemann.net |
| Uploaded | by AlexanderThiemann at 2022-06-25T06:07:19Z |
| Category | Web |
| Home page | https://github.com/agrafix/superbuffer#readme |
| Distributions | NixOS:0.3.1.2 |
| Reverse Dependencies | 1 direct, 11 indirect [details] |
| Downloads | 8248 total (20 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2022-06-25 [all 1 reports] |
Readme for superbuffer-0.3.1.2
[back to package description]Haskell SuperBuffer
The superbuffer packages was designed to efficiently build up bytestrings from IO actions producing
smaller chunks. The goal was to reduce memory overhead as much as possible while still being as fast as possible.
In our use case, it reduced total memory usage of the program from 350 MB (bytestring builder) to 50 MB (superbuffer).
For speed see benchmarks below. Note that the speed heavily depends on a good choice of the initial buffer size. superbuffer outperforms or performs similar to the bytestring alternatives consistently. superbuffer outperforms buffer-builder.
Usage
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Data.ByteString.SuperBuffer
import qualified Data.ByteString as BS
myBS :: IO BS.ByteString
myBS =
-- note: performance of superbuffer heavily depends on a
-- smart choice of the initial buffer size. Benchmark to
-- find what suits your needs.
withBuffer 1024 $ \buf ->
do appendBuffer buf "Hello "
appendBuffer buf "World!"