# (Best output appears to come from `memfile-preallocate`, compared to `memfile` and `buffered`)
#
# # Alternatives
# To use a specific mode: `cargo build --release --no-default-features --features mode-{memfile,buffered}[,logging]`
#
# # Logging
# Tracing can be disabled at compile-time for higher performance by disabling the `logging` feature (see above, but remove `,logging` from the features.)
default=["mode-memfile","logging"]
## --- Modes --- ##
# Mode: default
# Use physical-memory backed kernel file-descriptors. (see feature `memfile`.)
# Use an in-memory file for storage instead of a byte-buffer.
#
# This can draastically improve performance as it allows for the use of `splice()` and `send_file()` syscalls instead of many `read()` and `write()` ones.
#
# # *NOTE*: Requires the Linux `memfd_create()` syscall to be available in libc.
# # **WARNING**: Can potentially cause *full system OOM* if the initial size of the input pipe is:
# * Statically sized (the program can infer the size of standard input.)
# * The standard input file/buffer pipe size is large enough to pre-allocate enough splicing space to use up the rest of your physical RAM.
# (This will very likely not happen unless you're specifically trying to make it happen, however.)
# `memfile`: When unable to determine the size of the input, preallocate the buffer to a multiple of the system page-size before writing to it. This can save extra `ftruncate()` calls, but will also result in the buffer needing to be truncated to the correct size at the end if the sizes as not matched.
#
# *NOTE*: Requires `getpagesz()` to be available in libc.
# Decreases memory-handling function calls, resulting in less "used" memory and faster allocation speeds at the "cost" of mapping a huge amount of virtual memory.
# The capturing of spantraces will still happen if `logging` is enabled.
disable-logging=[]#["tracing/max_level_off"] <-- no longer needed, would enable the `tracing` feature which we don't want.
# Capture spantraces
#
# Will cause a slowdown, but provide more information in the event of an error or when debugging.
logging=["tracing","tracing-subscriber","tracing-error","color-eyre/capture-spantrace"]#, "recolored" <- XXX doesn't work in tracing output for some reason...]