{"id":11626535,"url":"https://github.com/Nonoum/ECL","last_synced_at":"2025-10-04T15:31:38.164Z","repository":{"id":245761349,"uuid":"124638276","full_name":"Nonoum/ECL","owner":"Nonoum","description":"Embedded Compression Library for low-memory systems","archived":false,"fork":false,"pushed_at":"2021-10-23T09:48:19.000Z","size":129,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-09-29T03:30:56.325Z","etag":null,"topics":["c","compression","embedded"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nonoum.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-10T08:49:43.000Z","updated_at":"2024-01-05T18:15:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"e5da6c30-3642-46a3-b812-82e937c85989","html_url":"https://github.com/Nonoum/ECL","commit_stats":null,"previous_names":["nonoum/ecl"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nonoum%2FECL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nonoum%2FECL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nonoum%2FECL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nonoum%2FECL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nonoum","download_url":"https://codeload.github.com/Nonoum/ECL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235273327,"owners_count":18963720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","compression","embedded"],"created_at":"2024-06-24T00:23:34.594Z","updated_at":"2025-10-04T15:31:38.157Z","avatar_url":"https://github.com/Nonoum.png","language":"C","funding_links":["https://www.patreon.com/Nonoum"],"categories":["Data processing"],"sub_categories":["Compression"],"readme":"EMBEDDED COMPRESSION LIBRARY\n===\n\n**ECL** aka EMBEDDED COMPRESSION LIBRARY is NOT ONLY for embedded, it is **mostly oriented for small data** and has special optimized **low-memory** modes for restricted environments.\n\n---\n### Language: C\n### Platforms: any\n### Endianness: any\n### Library version: 1.1.0\n---\n## NEWS\n\n### [PINNED] 11 July 2025: Announcing new functionality development, adding Patreon page for support\n- new type low-memory codec: TBA **[released Huff8 @ 30 September 2025]**\n- new type specialized low-memory codec (2): TBA\n- new type specialized low-memory codec (3): TBA\n- Patreon page: https://www.patreon.com/Nonoum\n\n### 30 September 2025: Releasing Huff8 (Huffman 8-bit) Ultra Low Memory codec. ECL 1.1.0\n- See description and benchmarks in sections with \"ECL:Huff8\" below\n- Fully Recursion-Free and predictable memory use\n- Compression with just 1.8kb extra RAM (or 1.5kb options)\n- Decompression with just 1kb extra RAM (or less for some cases, if needed)\n- Fast algorithms, for typical small data case even sorting is optimized to O(n)\n- Customizable read/write contexts for compressed data (for advanced use - e.g. embedding compressed data into Flash memory, unpacking into RAM)\n- Rich API\n- Fixed various warnings throughout library for XC8 compiler\n- Improved sample_nanolz (added *_auto_ex2 compressor function) file size handling capabilities\n- TBD next: *Extreme Low Memory* options (\u003c 100 bytes extra RAM) with more advanced technique\n\n### 23 October 2021: Release 1.0.3\n- Suppressed some 'loses precision' warnings (explicit conversions are added)\n\n### 23 October 2021: Release 1.0.2\n- Added/used ECL_SCOPED_CONST define\n- Added handling for ECL_EXCLUDE_HIMEM define (16bit-compilers friendly)\n- Minor fix in ZeroDevourer for ECL_USE_BITNESS_16\n\n### 28 March 2018: Release 1.0.1\n- Fixed tests compilation for clang 64 bit\n- Suppressed rare warning\n\n### 10 March 2018: Release 1.0.0\n- NanoLZ generic codec: decompressor, 7 compression modes, 2 *auto compression functions\n- NanoLZ schemes: Scheme1, Scheme2(demo)\n- ZeroDevourer codec\n- ZeroEater codec\n- high test coverage for all above\n- sample program to compress/decompress files in NanoLZ:Scheme1 format\n\n\n---\n### Version 1.0.1 Tested on:\n- Windows 7: msvc2013, msvc2015, gcc 4.8, gcc 7.2\n- Mac OS 10.12: clang (Apple LLVM version 8.0.0)\n- Embedded ARM Cortex-M3: armcc 5.06\n\n### Version 1.1.0 Tested on:\n- Windows 10: msvc2022, gcc 15.2.0, XC8 2.32 (compile only), arduino IDE (compile only)\n---\n\n\n## COMPRESSORS\nSome of modes of some compressors use intermediate buffers for compression, they don't use any implicit allocation (unless otherwise specified) - user can easily choose how to allocate buffers.\nEvery compression method that uses temporary buffer (say, more than 10 bytes) - has it specified in documentation near method declaration.\n\n### ECL:Huff8 - a Huffman codec implementation highly optimized for restricted memory environments. Works per-byte (at most 256 different codes).\n- use cases - various, useful for non-equal distribution of bytes in user data;\n- all code is recursion-free, no large stack arrays allocation, fully predictable and documented memory use;\n- provides API for advanced use, medium use, trivial use;\n- works with data blocks up to 65535 bytes (uint16 size), for larger datasets data should be split in smaller blocks (see sample); larger blocks make little sense as they harm statictics;\n- can be beneficial for very small amounts of data if data set has not many unique bytes;\n- compression ratio - small..middle;\n- compression ratio limit - 8, or infinite for edge case (if all bytes are equal);\n- compressors complexity for hypothetical worst case: O(n) + O(256^2)\n- compressors complexity for average case: O(n) + O(log2(256) * 256)\n- compressors complexity for normal small data case: O(n) + O(256)\n- compressors performance - middle..high, provides different modes (used-memory/performance trade off);\n- decompressor complexity - O(n);\n- decompressor performance - middle..high;\n- compressors buffer memory consumption - from 1.5kb to 1.8kb;\n- decompressors buffer memory consumption - from 1kb to 1.75kb (can be less than 1kb for some cases, if needed);\n- static const memory consumption - low;\n- stack consumption - normal;\n\n### ECL:NanoLZ - meticulously formatted version of traditional LZ77 algorithm.\n- use cases - various, same with other pure LZ algorithms;\n- takes advantage of repeated sequences with length of 2 bytes;\n- provides API for adjusting compressed data format (see \"schemes\") to gain better compression ratio for user's datasets (for advanced users);\n- can be beneficial for very small amounts of data (e.g. to fit some data into single Bluetooth Low Energy packet);\n- compression ratio - middle..high;\n- compression ratio limit - roughly infinite;\n- compressors complexity - linear..cubic;\n- compressors performance - low..high, provides different modes, configurable compression/performance trade off;\n- compressors performance for small data payloads - optimized;\n- decompressor complexity - linear;\n- decompressor performance - middle..high;\n- compressors buffer memory consumption - from zero to any, has different modes using 0, 256, 512,.. bytes for temporary buffers;\n- decompressor buffer memory consumption - zero;\n- static const memory consumption - low;\n- stack consumption - normal;\n- (TBD if needed) stream modes for processing data by chunks;\n\n### ECL:ZeroDevourer - a diff-oriented compressor that takes advantage of zero bytes (even single ones) in your stream.\n- use cases - incremental update of a structure FOO where you compress (FOO_before XOR FOO_after) rather than FOO itself, or data with significant amount of zeroes;\n- compression ratio - roughly, linearly depends on percentage of zeroes in your data, for target use cases - high;\n- compression ratio limit - roughly infinite;\n- compressor complexity - linear;\n- compressor performance - high (up to gigabyte per second);\n- decompressor complexity - linear;\n- decompressor performance - high (up to several gigabytes per second);\n- compressor buffer memory consumption - zero;\n- decompressor buffer memory consumption - zero;\n- static const memory consumption - 10 bytes;\n- stack consumption - low;\n- binary code size - small;\n\n### ECL:ZeroEater - a diff-oriented compressor that takes advantage of zero bytes (starting from two bytes in a row) in your stream.\n- use cases - incremental update of a structure FOO where you compress (FOO_before XOR FOO_after) rather than FOO itself, or data with significant amount of zeroes;\n- compression ratio - similar to `ZeroDevourer` but worse, for target use cases - high;\n- compression ratio limit - 64;\n- compressor has dry-run mode;\n- compressor complexity - linear;\n- compressor performance - very high (up to gigabyte per second);\n- decompressor complexity - linear;\n- decompressor performance - very high (up to several gigabytes per second);\n- compressor buffer memory consumption - zero;\n- decompressor buffer memory consumption - zero;\n- static const memory consumption - zero;\n- stack consumption - lowest;\n- binary code size - minimum;\n- doesn't require \"ECL_common.c\" file to be compiled;\n\n\n## FORMATS\nFormats of compressors are described in \"formats/\" dir, there are common features shared between compressors (except `ZeroEater`, which is simple and independent):\n- \"formats/ECL_JH.txt\" - format of Jumping Header, main feature and core of the library;\n- \"formats/ECL_E_number_format.txt\" - format of 'Extensible' numbers;\n\n\n## EXTRA CONFIGURING\nSee **ECL_config.h** for details on configuring, mostly controlled by ECL_USE* macros.\n- you can explicitly specify bitness of length variables on your consideration (`ECL_USE_BITNESS_16` / 32 / 64 macro), default is 32;\n- you can enable/disable branchless optimizations for your consideration (currently inefficient) - see `ECL_USE_BRANCHLESS`;\n- you can enable/disable internal asserts (work if system assert works e.g. no `NDEBUG` macro specified) - see `ECL_USE_ASSERT`;\n- you can disable malloc/free in case they cause compilation errors on some restricted platforms - see `ECL_DISABLE_MALLOC`;\n- you can disable/exclude memory-demanding functions by defining ECL_EXCLUDE_HIMEM (useful for 16bit compilers, e.g. arduino environment) to fix some warnings;\n- you can allow all `NanoLZ` schemes or only specific one - to let compiler inline more for better performance - see `ECL_NANO_LZ_ONLY_SCHEME`;\n- to use ECL as dynamic library - uncomment define for `ECL_USE_DLL`, to build dynamic library - define also `ECL_DLL_EXPORT`;\n- in case you don't have uint*_t types defined in `stdint.h` - define those types there near \"user setup part\";\n\n\n## PERFORMANCE BENCHMARKS for version 1.0.0 (NanoLZ, ZeroEater, ZeroDevourer)\nPC benchmarks are performed for *Intel core i5-3570k @ 3.4 GHz / Windows 7 64 bit / 16gb RAM 1600 MHz*.\nAll benchmarks are performed for ECL version 1.0.0.\nCompiled with GCC 7.2.0, options: `-m32 -Wall -Wextra -pedantic -O3`.\n- ECL sources are compiled as single file: \"ecl-all-c-included/ECL_all_c_included.c\" (and for Embedded benchmarks too);\n- Speed is in megabytes per second (mb/s);\n- For `NanoLZ` used Scheme1 unless otherwise specified;\n- ECL is built for 32 bits (`ECL_USE_BITNESS_32`, default option) unless otherwise specified. In most cases 32bit build is the most efficient;\n- Compressor parameter (for LZ4_HC - *compressionLevel*, for `NanoLZ` - *search_limit*) is further referenced as *Param*;\n- *Ratio* is size of compressed data comparing to size of original data, e.g. compressing 1000 bytes -\u003e 100 bytes corresponds to ratio 0.1.\n\nBenchmarking small datasets (PC and Embedded environment)\n---\nUsed samples around 2 kb each. Run in big external cycle:\n- main comparison - `NanoLZ` versus [LZ4] (which can also be configured for low-memory);\n- for PC: `NanoLZ` demo scheme (Scheme2) - to show that you can achieve different parameters within `NanoLZ`, if needed;\n- for PC: [LZ4] in high-compression mode (LZ4_HC) with big memory buffers used;\n- for PC: `NanoLZ` with bigger memory buffers used (mid2min, fast1/fast2 using *window_size_bits=11* - further referenced as *Window*) for detailed codec comparison on small data.\n\n### PC environment\n\n| Compressor                                    | Param |  Ratio  | Compression  | Decompression | Compressor memory             |\n| --------------------------------------------- | ----- | ------- | ------------ | ------------- | ----------------------------- |\n| LZ4_compress_default (v1.8.1)                 |       |**0.548**|  **625 mb/s**|    2020 mb/s  | **256 bytes**                 |\n| **ECL_NanoLZ_Compress_mid1min**               |       |**0.465**|  **249 mb/s**|     335 mb/s  | **256 bytes**                 |\n| ECL_NanoLZ_Compress_mid1                      |   2   |  0.427  |    114 mb/s  |     332 mb/s  | **256 bytes**                 |\n| ECL_NanoLZ_Compress_mid1                      |   3   |  0.413  |     81 mb/s  |     332 mb/s  | **256 bytes**                 |\n| ECL_NanoLZ_Compress_mid1                      |   4   |  0.4    |     65 mb/s  |     332 mb/s  | **256 bytes**                 |\n| ECL_NanoLZ_Compress_mid1                      |   5   |  0.397  |     56 mb/s  |     337 mb/s  | **256 bytes**                 |\n| ECL_NanoLZ_Compress_mid1                      |  10   |  0.387  |     39 mb/s  |     344 mb/s  | **256 bytes**                 |\n| ECL_NanoLZ_Compress_mid1                      |  50   |**0.377**|     24 mb/s  |     355 mb/s  | **256 bytes**                 |\n| ECL_NanoLZ_Compress_mid1min **Scheme2 (demo)**|       |  0.592  |    228 mb/s  |   **890 mb/s**| **256 bytes**                 |\n|                                               |       |         |              |               |                               |\n| **ECL_NanoLZ_Compress_mid2min**               |       |**0.465**|  **347 mb/s**|     334 mb/s  | **513 bytes**                 |\n| ECL_NanoLZ_Compress_fast1                     |  20   |  0.383  |     60 mb/s  |     340 mb/s  | 4612 bytes (**16bit build**)  |\n| ECL_NanoLZ_Compress_fast1                     |  20   |  0.383  |     66 mb/s  |     342 mb/s  | 9224 bytes                    |\n| **ECL_NanoLZ_Compress_fast2**                 |  20   |  0.377  |   **93 mb/s**|     343 mb/s  | 135172 bytes (**16bit build**)|\n| **ECL_NanoLZ_Compress_fast2**                 |  20   |  0.377  |   **79 mb/s**|     350 mb/s  | 270344 bytes                  |\n| ECL_NanoLZ_Compress_fast2                     | 100   |**0.37** |     54 mb/s  |     350 mb/s  | 135172 bytes (**16bit build**)|\n| ECL_NanoLZ_Compress_fast2                     | 100   |**0.37** |     50 mb/s  |     360 mb/s  | 270344 bytes                  |\n|                                               |       |         |              |               |                               |\n| LZ4_compress_HC (v1.8.1)                      |   3   |**0.49** |     87 mb/s  |    2230 mb/s  | 384 kb                        |\n| LZ4_compress_HC (v1.8.1)                      |   9   |**0.49** |     59 mb/s  |    2230 mb/s  | 384 kb                        |\n| LZ4_compress_HC (v1.8.1)                      |  11   |**0.49** |     16 mb/s  |    2230 mb/s  | 384 kb                        |\n| LZ4_compress_HC (v1.8.1)                      |  12   |**0.49** |     10 mb/s  |    2230 mb/s  | 384 kb                        |\n\nOn some other small datasets (highly compressible) `NanoLZ`:Scheme1 decompression speed exceeded **1000 mb/s**,\nwhile compression speed of ECL_NanoLZ_Compress_mid2min reached **570 mb/s**.\n\n### Embedded environment\n- hardware: ARM Cortex-M3 120 MHz;\n- compiler: armcc 5.06;\n- optimization options: `-O3`.\n\n| Compressor                      | Param |  Ratio  | Compression  | Decompression | Compressor memory |\n| ------------------------------- | ----- | ------- | ------------ | ------------- | ----------------- |\n| LZ4_compress_default (v1.8.0)   |       |**0.53** |**1.785 mb/s**|   10.12 mb/s  | **1024 bytes**    |\n| **ECL_NanoLZ_Compress_mid2min** |       |**0.465**|**1.822 mb/s**|    2.42 mb/s  | **513 bytes**     |\n| ECL_NanoLZ_Compress_mid2        |   2   |  0.427  |  0.865 mb/s  |    2.42 mb/s  | **513 bytes**     |\n| ECL_NanoLZ_Compress_mid2        |   3   |  0.413  |  0.718 mb/s  |    2.46 mb/s  | **513 bytes**     |\n| ECL_NanoLZ_Compress_mid2        |   4   |  0.4    |  0.636 mb/s  |    2.48 mb/s  | **513 bytes**     |\n| ECL_NanoLZ_Compress_mid2        |   5   |  0.397  |  0.584 mb/s  |    2.54 mb/s  | **513 bytes**     |\n| ECL_NanoLZ_Compress_mid2        |  10   |  0.387  |  0.455 mb/s  |    2.57 mb/s  | **513 bytes**     |\n\n[LZ4]: http://www.lz4.org/\n\nBenchmarking large datasets (only PC environment)\n---\nBig datasets used here to show performance measured on big data without wrapping in external cycle, they also show that `NanoLZ` is inappropriate choice for big data.\nOn my measurements compression ratio of [LZ4] wins on data bigger than around 25 kb (this bound isn't accurately measured and appropriate statistic isn't provided).\nThough, again, **with custom scheme** you are able to achieve different characteristics.\n\n#### Benchmarks for data samples from [Silesia Corpus] (further referenced as *Silesia*): 12 files of different types, sizes range in 6..51 mb:\n\n| Compressor                | Param | Window | Compression    | Decompression   | Compressor memory |\n| ------------------------- | ----- | ------ | -------------- | --------------- | ----------------- |\n| ECL_NanoLZ_Compress_fast2 |    1  |   16   |  57..158 mb/s  |  122..310 mb/s  | 512kb             |\n| ECL_NanoLZ_Compress_fast2 |   10  |   16   |  25..98 mb/s   |  132..435 mb/s  | 512kb             |\n| ECL_NanoLZ_Compress_fast2 |  100  |   16   |  8..31 mb/s    |  164..569 mb/s  | 512kb             |\n| ECL_NanoLZ_Compress_fast2 |   10  |   18   |  22..97 mb/s   |  135..436 mb/s  | 1.3mb             |\n| ECL_NanoLZ_Compress_fast2 |  100  |   18   |  5..23 mb/s    |  161..586 mb/s  | 1.3mb             |\n|                           |       |        |                |                 |                   |\n| ECL_ZeroEater_Compress    |       |        | 518..1446 mb/s | 1353..7000 mb/s | 0                 |\n| ECL_ZeroDevourer_Compress |       |        | 341..1456 mb/s | 739..10317 mb/s | 0                 |\n\nNote that prodigious decompression speed of `ZeroEater` and `ZeroDevourer` is achieved on files they cannot compress, see next table for accumulated statistic.\n\n#### Benchmarks for single *Silesia*.tar file (202 mb):\n\n| Compressor                    | Param | Window |  Ratio  | Compression | Decompression | Compressor memory |\n| -------------------------     | ----- | ------ | ------- | ----------- | ------------- | ----------------- |\n| memcpy                        |       |        |  1.000  |  6300 mb/s  |  6300 mb/s    | 0                 |\n| LZ4_compress_default (v1.8.1) |       |        |  0.479  |  437 mb/s   |  1543 mb/s    | 16 kb             |\n| LZ4_compress_HC (v1.8.1)      |    3  |        |  0.383  |  74.5 mb/s  |  1704 mb/s    | 384 kb            |\n| LZ4_compress_HC (v1.8.1)      |    9  |        |**0.367**|  26.9 mb/s  |  1783 mb/s    | 384 kb            |\n|                               |       |        |         |             |               |                   |\n| ECL_NanoLZ_Compress_fast2     |    1  |   16   |  0.473  |  92.5 mb/s  |  192.7 mb/s   | 512 kb            |\n| ECL_NanoLZ_Compress_fast2     |   10  |   16   |  0.407  |  47.5 mb/s  |  221.5 mb/s   | 512 kb            |\n| ECL_NanoLZ_Compress_fast2     |  100  |   16   |  0.39   |  15.3 mb/s  |  250 mb/s     | 512 kb            |\n| ECL_NanoLZ_Compress_fast2     |   10  |   18   |  0.405  |  42.7 mb/s  |  222 mb/s     | 1.3 mb            |\n| ECL_NanoLZ_Compress_fast2     |  100  |   18   |**0.385**|  10.5 mb/s  |  254 mb/s     | 1.3 mb            |\n|                               |       |        |         |             |               |                   |\n| ECL_ZeroEater_Compress dry    |       |        |  0.948  | 1136 mb/s   |               | 0                 |\n| ECL_ZeroEater_Compress        |       |        |  0.948  |**925 mb/s** |**2940 mb/s**  | 0                 |\n| ECL_ZeroDevourer_Compress     |       |        |  0.935  |  696 mb/s   |  1905 mb/s    | 0                 |\n\n[Silesia Corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia\n\n\n## PERFORMANCE BENCHMARKS for ECL:Huff8 / version 1.1.0\n### Windows environment - all measurements are done within 'sample/sample_huff8_blocked.cpp', 'memcpy' variant has overhead of auxiliary code in sample.\n- hardware: AMD Ryzen 5600x, 32gb 3600mhz RAM\n- compiler: gcc version 15.2.0\n- optimization options: -O3\n- Param is 'block size' parameter of the sample, which is 1..65535 (~32000 is optimal **here**)\n- **ECL_Huff8_Compress16_ULM_Raw** (* **Compress ULM** in table) uses 1.8kb extra memory (fully self-sufficient compresor)\n- **ECL_Huff8_TryCompress16_TSpec768_Raw** (* **Compress 768** in table) uses 1.5kb extra memory (fully self-sufficient compresor)\n- **ECL_Huff8_TryCompress16_TSpec512_Raw** (* **Compress 512** in table) uses 1.5kb extra memory (fully self-sufficient compresor)\n- **ECL_Huff8_Decompress_Raw** (* **Decompress** in table) uses 1kb extra memory (fully self-sufficient decompresor)\n- **ECL_Huff8_DecompressWithDTable768_Raw** (* **Decompress Fast** in table) uses 1.75kb extra memory (fully self-sufficient decompresor)\n- 'error' mark means that **a restricted compressor function** couldn't process some block (too big size)\n\n#### System performance reference for *Silesia*.tar\n\n| Param | Ratio | \"Compression\" replaced with memcpy | \"Decompression\" replaced with memcpy |\n| ----- | ----- | ---------------------------------- | ------------------------------------ |\n|  1000 | \u003e1.00 |                         ~3300 mb/s |                           ~5800 mb/s |\n| 65535 | \u003e1.00 |                         ~3700 mb/s |                           ~6300 mb/s |\n\n\n#### Huff8 performance for *Silesia*.tar\n| Param | Ratio | Compress ULM | Compress 768 | Compress 512 | Decompress | Decompress Fast |\n| ----- | ----- | ------------ | ------------ | ------------ | ---------- | --------------- |\n|       |       |   1816 bytes |   1552 bytes |   1536 bytes | 1024 bytes |      1792 bytes |\n|       |       |              |              |              |            |                 |\n|   100 | 0.934 |    73.5 mb/s |    70.3 mb/s |    70.1 mb/s |  54.1 mb/s |       54.3 mb/s |\n|   500 | 0.734 |   130.3 mb/s |   119.2 mb/s |   118.8 mb/s |  53.0 mb/s |      179.0 mb/s |\n|  1000 | 0.686 |   158.1 mb/s |   142.0 mb/s |   141.3 mb/s |  54.9 mb/s |      210.9 mb/s |\n|  2000 | 0.654 |**179.8 mb/s**|   159.5 mb/s |   159.0 mb/s |  57.0 mb/s |   **234.7 mb/s**|\n|  4000 | 0.634 |   200.7 mb/s |   175.8 mb/s |        error |  60.0 mb/s |      251.2 mb/s |\n|  8000 | 0.622 |   223.2 mb/s |   192.6 mb/s |        error |  63.1 mb/s |      263.4 mb/s |\n| 16000 | 0.617 |   240.6 mb/s |   205.5 mb/s |        error |  66.4 mb/s |      271.6 mb/s |\n| 32000 | 0.616 |   250.5 mb/s |   212.5 mb/s |        error |  69.8 mb/s |      276.5 mb/s |\n| 65535 | 0.619 |**258.5 mb/s**|        error |        error |  73.1 mb/s |   **280.0 mb/s**|\n\n\n#### Huff8 results for \"nci\" file from *Silesia*.tar\n| Param | Ratio | Compress ULM | Decompress Fast |\n| ----- | ----- | ------------ | --------------- |\n| 32000 | 0.306 |   338.3 mb/s |      391.9 mb/s |\n\n#### Huff8 results for \"osdb\" file from *Silesia*.tar\n| Param | Ratio | Compress ULM | Decompress Fast |\n| ----- | ----- | ------------ | --------------- |\n| 32000 | 0.836 |   224.2 mb/s |      232.2 mb/s |\n\n## MULTITHREADING\nCodecs don't share any non-const data, so API is thread safe.\n\n\n## SAMPLE TESTING PROGRAM\nThere are sample programs to compress/decompress in via command line (see **\"sample/\"** dir):\n- `NanoLZ`:Scheme1 format (**\"sample/sample_nanolz.cpp\"**);\n- `Huff8` blocked variant (**\"sample/sample_huff8_blocked.cpp\"**);\nIt's enough to compile single **\"sample/\u003cfoo\u003e.cpp\"** file, some building scripts are provided in same dir.\nSamples are unable to compress too large files as they're simplified (pre-read whole file) and used for benchmarks.\n\n\n## USAGE\nIn general usage is pretty straightforward - you call \\*Compress method, you call \\*Decompress method - that's it.\n- usage samples present in headers of each codec;\n- see **\"sample/sample_nanolz.cpp\"**, **\"sample/sample_huff8_blocked.cpp\"** example programs to encode/decode files;\n- you can find examples in tests located in **\"tests/\"** dir.\n\n\n## BUILDING\nIt's enough to build single **\"ecl-all-c-included/ECL_all_c_included.c\"** file, so do it unless you have reasons to compile minimum amount of code.\nIf you need to minimize amount of code to compile, then: to have compressor \"FOO\" available - include \"ECL_FOO.h\", compile \"ECL_common.c\" + \"ECL_FOO.c\".\n\nIf you need a static/dynamic library instead of adding ECL sources to your project - you will have to compile it yourself (no such scripts here). To build dynamic library define `ECL_USE_DLL` and `ECL_DLL_EXPORT` macros, to import it - define only `ECL_USE_DLL` macro.\n\nNote that building as C rather than C++ results in higher performance due to absence of code generated for exception handling, so simple #including code into some of your C++ source files is not the most efficient option.\n\n\n## TESTS\n- unit tests are in **\"tests/\"** dir, can be built and launched with scripts in same place. Basically single **\"tests/tests.cpp\"** file is enough to be compiled;\n- scripts in **\"tests/\"** dir build and run ECL consequently for 16, 32 and 64 bits (bitness of ECL_usize);\n- executable test file has optional \"depth\" parameter on launch: a number between -10 and 1000 (e.g. \"tests.exe 50\"). It determines tests coverage and time spent on tests (-10 for fast run, 1000 for very deep/slow run);\n- sources of tests can be easily embedded into another project and run any amount of times with any parameters from there, see **\"tests/tests.cpp\"**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNonoum%2FECL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNonoum%2FECL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNonoum%2FECL/lists"}