Skip to content

Conversation

dciliske
Copy link

@dciliske dciliske commented May 8, 2020

So, like the issue that was raised last fall (#16), I need checksum support for frames. The Advanced Compression API adds this capability, so I've added an interface onto it.

@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #25 into master will decrease coverage by 2.76%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
- Coverage   95.37%   92.60%   -2.77%     
==========================================
  Files           5        5              
  Lines         562      622      +60     
==========================================
+ Hits          536      576      +40     
- Misses         16       30      +14     
- Partials       10       16       +6     
Impacted Files Coverage Δ
gozstd.go 90.24% <66.66%> (-7.61%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3452344...5c0846f. Read the comment docs.

@kaxap
Copy link

kaxap commented Jun 18, 2020

any news on merging this?

@valyala
Copy link
Owner

valyala commented Jun 19, 2020

@kaxap , @dciliske , sorry for long delay - I had no time to review the PR :(

I'll try to allocate some time for reviewing it soon.

@gaby
Copy link

gaby commented Jan 19, 2023

@valyala Friendly ping 2.5 years later 😂 Any chance you can take a look at this PR?

@myxo
Copy link

myxo commented May 23, 2023

Hey, any chance this PR to be merged? Checksum support is highly desirable feature.

GrigoryEvko added a commit to GrigoryEvko/gozstd that referenced this pull request Aug 2, 2025
- Add cparams.go with all compression parameters and strategies
- Add CCtx type for advanced compression context management
- Add methods: NewCCtx(), Reset(), SetParameter(), SetPledgedSrcSize(), Compress()
- Add compress2() and compress2Internal() using ZSTD_compress2
- Support checksum flag and other compression parameters
- Add tests for parameter setting and checksum functionality
- Use void* pointers to match our CGO improvements
GrigoryEvko added a commit to GrigoryEvko/gozstd that referenced this pull request Aug 2, 2025
…ng codebase

Integrated community contributions:
- PR valyala#49: CGO wrapper improvements for 5-7% performance gain on large buffers
  - Use void* instead of uintptr_t to avoid memory allocations
  - Direct Go slice usage via reflect.SliceHeader
- PR valyala#25: Advanced Compression API with checksum support
  - Added CCtx type for advanced compression contexts
  - Added SetParameter/GetParameter methods
  - Added Reset and Compress2 methods
  - Full support for all ZSTD compression parameters
- PR valyala#63: Exposed CompressDictLevel as public API
  - Allows fine-grained control over dictionary compression levels
- PR valyala#66: RISC-V 64-bit architecture support
  - Updated Zig builder to 0.13.0
  - Added linux_riscv64 target
- PR valyala#60: Memory-optimized dictionary functions
  - Added NewCDictByRef/NewDDictByRef to avoid data copying
  - Reduces memory usage for large dictionaries

Infrastructure improvements:
- Created modern Dockerfile with Alpine Linux and latest Zig
- Fixed build process issues with clean target
- Updated minimum Go version to 1.24

Code organization:
- Moved Docker configs to build/docker/
- Moved scripts to scripts/
- Moved upstream zstd to contrib/
- Moved test data to test/
- Created comprehensive examples in examples/
- Kept all Go source files in root for package compatibility

Testing enhancements:
- Added Silesia Corpus compression tests with speed measurements
- Created 33 aggressive fuzz tests targeting known vulnerabilities
- Added comprehensive tests for Advanced API
- Added benchmarks comparing raw zstd vs wrapper performance

The wrapper now shows 6-10% performance improvements for compression
while maintaining identical compression ratios.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants