From c88d16baaf3e88029b40d43eb254e90613b95187 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 11 Jan 2017 15:26:58 +0100 Subject: util/cbfstool: Add cbfs-compression-tool cbfs-compression-tool provides a way to benchmark the compression algorithms as used by cbfstool (and coreboot) and allows to pre-compress data for later consumption by cbfstool (once it supports the format). For an impression, the benchmark's results on my machine: measuring 'none' compressing 10485760 bytes to 10485760 took 0 seconds measuring 'LZMA' compressing 10485760 bytes to 1736 took 2 seconds measuring 'LZ4' compressing 10485760 bytes to 41880 took 0 seconds And a possible use for external compression, parallel and non-parallel (60MB in 53 files compressed to 650KB on a machine with 40 threads): $ time (ls -1 *.* |xargs -n 1 -P $(nproc) -I '{}' cbfs-compression-tool compress '{}' out/'{}' LZMA) real 0m0.786s user 0m11.440s sys 0m0.044s $ time (ls -1 *.* |xargs -n 1 -P 1 -I '{}' cbfs-compression-tool compress '{}' out/'{}' LZMA) real 0m10.444s user 0m10.280s sys 0m0.064s Change-Id: I40be087e85d09a895b1ed277270350ab65a4d6d4 Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/18099 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- util/cbfstool/cbfs_image.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'util/cbfstool/cbfs_image.c') diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index c34ca8366c..e530224fac 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -50,15 +50,6 @@ * (old) cbfstool. */ #define CBFS_FILENAME_ALIGN (16) -/* Type and format */ - -static const struct typedesc_t types_cbfs_compression[] = { - {CBFS_COMPRESS_NONE, "none"}, - {CBFS_COMPRESS_LZMA, "LZMA"}, - {CBFS_COMPRESS_LZ4, "LZ4"}, - {0, NULL}, -}; - static const char *lookup_name_by_type(const struct typedesc_t *desc, uint32_t type, const char *default_value) { -- cgit v1.2.3