mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
name old speed new speed delta wuffs_gif_decode_1k_bw/clang11 683MB/s ± 0% 682MB/s ± 0% ~ (p=0.690 n=5+5) wuffs_gif_decode_1k_color_full_init/clang11 168MB/s ± 0% 184MB/s ± 0% +10.01% (p=0.008 n=5+5) wuffs_gif_decode_1k_color_part_init/clang11 204MB/s ± 0% 230MB/s ± 0% +12.77% (p=0.008 n=5+5) wuffs_gif_decode_10k_bgra/clang11 746MB/s ± 0% 819MB/s ± 0% +9.90% (p=0.008 n=5+5) wuffs_gif_decode_10k_indexed/clang11 200MB/s ± 0% 218MB/s ± 0% +8.97% (p=0.008 n=5+5) wuffs_gif_decode_20k/clang11 246MB/s ± 0% 257MB/s ± 0% +4.33% (p=0.008 n=5+5) wuffs_gif_decode_100k_artificial/clang11 543MB/s ± 0% 562MB/s ± 0% +3.44% (p=0.008 n=5+5) wuffs_gif_decode_100k_realistic/clang11 210MB/s ± 0% 220MB/s ± 0% +4.90% (p=0.008 n=5+5) wuffs_gif_decode_1000k_full_init/clang11 214MB/s ± 0% 224MB/s ± 0% +4.96% (p=0.008 n=5+5) wuffs_gif_decode_1000k_part_init/clang11 214MB/s ± 0% 224MB/s ± 0% +4.98% (p=0.008 n=5+5) wuffs_gif_decode_anim_screencap/clang11 1.24GB/s ± 0% 1.29GB/s ± 0% +3.85% (p=0.008 n=5+5) wuffs_gif_decode_1k_bw/gcc10 649MB/s ± 0% 588MB/s ± 0% -9.42% (p=0.008 n=5+5) wuffs_gif_decode_1k_color_full_init/gcc10 167MB/s ± 0% 198MB/s ± 0% +18.57% (p=0.008 n=5+5) wuffs_gif_decode_1k_color_part_init/gcc10 195MB/s ± 0% 251MB/s ± 0% +28.64% (p=0.008 n=5+5) wuffs_gif_decode_10k_bgra/gcc10 753MB/s ± 0% 871MB/s ± 0% +15.64% (p=0.008 n=5+5) wuffs_gif_decode_10k_indexed/gcc10 199MB/s ± 0% 233MB/s ± 0% +16.86% (p=0.008 n=5+5) wuffs_gif_decode_20k/gcc10 258MB/s ± 0% 265MB/s ± 0% +2.93% (p=0.008 n=5+5) wuffs_gif_decode_100k_artificial/gcc10 560MB/s ± 0% 561MB/s ± 0% +0.19% (p=0.008 n=5+5) wuffs_gif_decode_100k_realistic/gcc10 221MB/s ± 0% 227MB/s ± 0% +2.65% (p=0.008 n=5+5) wuffs_gif_decode_1000k_full_init/gcc10 227MB/s ± 0% 232MB/s ± 0% +2.29% (p=0.008 n=5+5) wuffs_gif_decode_1000k_part_init/gcc10 227MB/s ± 0% 232MB/s ± 0% +2.28% (p=0.008 n=5+5) wuffs_gif_decode_anim_screencap/gcc10 1.29GB/s ± 0% 1.28GB/s ± 0% -0.22% (p=0.008 n=5+5)
72 lines
2.2 KiB
Markdown
72 lines
2.2 KiB
Markdown
# Standard Library
|
|
|
|
Wuffs' standard library consists of multiple packages, each implementing a
|
|
particular file format or algorithm. Those packages can be grouped into several
|
|
categories:
|
|
|
|
- [Compression Decoders](/doc/std/compression-decoders.md).
|
|
- [Hashers](/doc/std/hashers.md).
|
|
- [Image Decoders](/doc/std/image-decoders.md).
|
|
|
|
The general pattern is that a package `foo` (e.g. `jpeg`, `png`) contains a
|
|
struct `bar` (e.g. `hasher`, `decoder`, etc) that implements a
|
|
package-independent interface. For example, every compression decoder struct
|
|
would have a `transform_io` method. In C, this would be invoked as
|
|
|
|
```
|
|
// Allocate and initialize the struct.
|
|
wuffs_foo__decoder* dec = etc;
|
|
|
|
// Do the work. Error checking is not shown, for brevity.
|
|
wuffs_base__status status = wuffs_foo__decoder__transform_io(dec, etc);
|
|
```
|
|
|
|
When that C library is used as C++, that last line can be shortened:
|
|
|
|
```
|
|
wuffs_base__status status = dec->transform_io(etc);
|
|
```
|
|
|
|
See also the [glossary](/doc/glossary.md), as well as the notes on:
|
|
|
|
- [Coroutines](/doc/note/coroutines.md).
|
|
- [Initialization](/doc/note/initialization.md).
|
|
- [Statuses](/doc/note/statuses.md).
|
|
|
|
|
|
## Modules and Dependencies
|
|
|
|
By default, building Wuffs' standard library builds the entire thing (provided
|
|
that you've defined the `WUFFS_IMPLEMENTATION` C macro), implementing a variety
|
|
of codecs and file formats.
|
|
|
|
Packages can be individually allow-listed, for smaller binaries and faster
|
|
compiles. Opt in by also defining `WUFFS_CONFIG__MODULES` and then also
|
|
`WUFFS_CONFIG__MODULE__ETC` for each `ETC` (and its dependencies, listed below)
|
|
to enable.
|
|
|
|
- `ADLER32: BASE`
|
|
- `BMP: BASE`
|
|
- `BZIP2: BASE`
|
|
- `CBOR: BASE`
|
|
- `CRC32: BASE`
|
|
- `DEFLATE: BASE`
|
|
- `GIF: BASE`
|
|
- `GZIP: BASE, CRC32, DEFLATE`
|
|
- `JPEG: BASE`
|
|
- `JSON: BASE`
|
|
- `LZW: BASE`
|
|
- `NETPBM: BASE`
|
|
- `NIE: BASE`
|
|
- `PNG: BASE, ADLER32, CRC32, DEFLATE, ZLIB`
|
|
- `TGA: BASE`
|
|
- `WBMP: BASE`
|
|
- `ZLIB: BASE, ADLER32, DEFLATE`
|
|
|
|
For the [auxiliary modules](/doc/note/auxiliary-code.md):
|
|
|
|
- `AUX_CBOR: AUX_BASE, BASE, CBOR`
|
|
- `AUX_IMAGE: AUX_BASE, BASE` and whichever image-related modules (and their
|
|
dependencies) you want, e.g. `GIF`, `PNG`, etc.
|
|
- `AUX_JSON: AUX_BASE, BASE, JSON`
|