Skip to content

Commit

Permalink
lz4 tuning #19 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
aloneguid authored Aug 3, 2023
1 parent 0182656 commit 5421467
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/full.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Full Flow'

env:
VERSION: 1.5.0
VERSION: 1.5.1
#PACKAGE_SUFFIX: '-preview-03'
PACKAGE_SUFFIX: ''
ASM_VERSION: 1.0.0
Expand Down
5 changes: 3 additions & 2 deletions native/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,12 @@ bool compress_lz4(
}

if(compress) {
// see https://github.com/aloneguid/ironcompress/pull/19
int acceleration = LZ4_ACCELERATION_DEFAULT;
if(compression_level == compression_level::fastest)
acceleration = LZ4_ACCELERATION_MAX;
acceleration = 50;
else if(compression_level == compression_level::balanced)
acceleration = LZ4_ACCELERATION_MAX / 2;
acceleration = 2;

*output_buffer_size = LZ4_compress_fast(input_buffer, output_buffer, input_buffer_size, *output_buffer_size, acceleration);
return *output_buffer_size != 0;
Expand Down

0 comments on commit 5421467

Please sign in to comment.