Cargo Features

bilrost = { version = "0.1008.0", default-features = false, features = ["std", "derive", "detailed-errors", "extended-diagnostics", "no-recursion-limit", "third-party-type-support", "arrayvec", "bytestring", "hashbrown", "smallvec", "thin-vec", "tinyvec", "auto-optimize", "auto-self-copy-optimization", "self-copy-optimization", "auto-unroll-varint-encoding", "unroll-varint-encoding", "full-test-suite", "pprof"] }
default = auto-optimize, derive, detailed-errors, std

These default features are set whenever bilrost is added without default-features = false somewhere in the dependency tree.

std default
derive default full-test-suite?

Enables bilrost-derive

detailed-errors default full-test-suite?

Enables thin-vec

extended-diagnostics full-test-suite?

Enables const_panic

third-party-type-support full-test-suite? = arrayvec, bytestring, hashbrown, smallvec, thin-vec, tinyvec
arrayvec third-party-type-support?

Enables arrayvec

bytestring third-party-type-support?

Enables bytestring

hashbrown third-party-type-support?

Enables hashbrown

smallvec third-party-type-support?

Enables smallvec

thin-vec third-party-type-support?

Enables thin-vec

tinyvec third-party-type-support?

Enables tinyvec

auto-optimize default = auto-self-copy-optimization, auto-unroll-varint-encoding

Optimization controls. "auto-optimize" enables the default setting for all optimizations.

auto-self-copy-optimization auto-optimize

Self-copy optimization: This causes copies of short segments of bytes into the prepend buffer to be explicit and happen in reversed order rather than delegating to the intrinsic memcpy. On some architectures (x86_64) this can be a significant improvement; on others (arm64) it's negligible or worse.

The "auto" feature here enables this optimization when on platforms that seem to benefit from it,
and the regular feature enables it unconditionally.

auto-unroll-varint-encoding auto-optimize = unroll-varint-encoding

Unroll varint encoding: This changes the spelling of the functions that encode varint values to branch in a way that bisects the resulting length of the varint and then calls an unrollable fixed-length encoding loop once the length is known, rather than implementing a plain loop that may branch on each iteration if the varint is done encoding.

This improves performance significantly in benchmarks on some CPUs but not on others, at the cost of emitted code size. The observed impact of this optimization is still rather conditional regardless: unless the data encoded involves long arrays of encoded varints, the advantages are likely to be far less prevalent.

As in other features, the "auto" feature enables the optimization when it seems like a good idea (currently always) and the regular feature enables it unconditionally.

unroll-varint-encoding auto-unroll-varint-encoding?

Affects encoding::encode_varint, encoding::prepend_varint

full-test-suite = derive, detailed-errors, extended-diagnostics, third-party-type-support

Enables pprof profiling in benchmarks.

Enables pprof

pprof prevents building on windows, so must be an optional feature