Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 2.62 KB

CONTRIBUTING.md

File metadata and controls

63 lines (49 loc) · 2.62 KB

Contributing to lzbench

Thank you for considering contributing to lzbench! Please follow the guidelines below to ensure a smooth and efficient contribution process.

1. Passing Tests

All contributions should pass (green tick) all Azure Pipeline tests for lzbench pipeline, which will be triggered automatically.

2. Updating Existing Codecs

When updating an existing codec, please follow these steps:

  • Update the codec files (e.g., brotli/*).
  • Update Makefile if there are new source files that need to be built.
  • Update the codec version in bench/lzbench.h and README.md.
  • Add a new entry in CHANGELOG
  • Refer to example commit: update brotli to 1.1.0.

3. Adding New Codecs

When adding a new codec, please follow these steps:

  • Create a new directory with the codec files (e.g., xxxx).
  • Add a new codec to README.md with a proper link to the upstream repository.
  • Add a new entry in CHANGELOG
  • Add the new codec to bench/lzbench.h and increase LZBENCH_COMPRESSOR_COUNT.
  • Add declarations of compression and decompression functions in bench/codecs.h, e.g.:
#ifndef BENCH_REMOVE_XXXX
int64_t lzbench_xxxx_compress(char* inbuf, size_t insize, char* outbuf, size_t outsize, size_t level, size_t, char*);
int64_t lzbench_xxxx_decompress(char* inbuf, size_t insize, char* outbuf, size_t outsize, size_t, size_t, char*);
#else
#define lzbench_xxxx_compress NULL
#define lzbench_xxxx_decompress NULL
#endif // BENCH_REMOVE_XXXX
  • Add definitions of compression and decompression functions in bench/lz_codecs.cpp, bench/symmetric_codecs.cpp (BWT, PPM-based), or bench/misc_codecs.cpp, e.g.:
#ifndef BENCH_REMOVE_XXXX
#include "XXXX/YYYY.h"
int64_t lzbench_xxxx_compress(char* inbuf, size_t insize, char* outbuf, size_t outsize, size_t level, size_t, char*) { }
int64_t lzbench_xxxx_decompress(char* inbuf, size_t insize, char* outbuf, size_t outsize, size_t, size_t, char*) { }
#endif
  • If a codec supports multi-threading, it should be disabled since all codecs are currently tested using a single thread. The only exception is GLZA, which is very slow and not tested with the default codecs.

  • Update Makefile:

ifeq "$(DONT_BUILD_XXXX)" "1"
    DEFINES += -DBENCH_REMOVE_XXXX
else
    XXXX_FILES = XXXX/YYYY.o XXXX/YYYY_Dec.o XXXX/YYYY_Enc.o
endif

And ensure the new codec in Makefile is linked in:

lzbench: $(BZIP2_FILES) $(KANZI_FILES) ... $(XXXX_FILES)