-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement zstd Sequence Producer API #290
Conversation
Untested, and needs updated commenting fallback flag, registerSeqProd from within CompressionContext
Add javadoc and remove miscellaneous unneeded comments Tentatively ready for a PR (but should be tested with qat-java implementation of external sequence producer)
…context gets its own state allocation
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #290 +/- ##
============================================
+ Coverage 59.57% 59.74% +0.16%
- Complexity 300 307 +7
============================================
Files 26 26
Lines 1415 1473 +58
Branches 163 170 +7
============================================
+ Hits 843 880 +37
- Misses 417 436 +19
- Partials 155 157 +2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I left 2 small nits
Thanks for fixing that unnecessary unlocking. Can you rebase it? Looks there is some minor conflict that prevents the merge. |
Should be all set now, thanks! |
I rebased and merged that manually |
I had to skip 61ac4c1 as it had conflicts and that part was reworked quite extensively recently |
@Coder-256 If you have it integrated with QAT-ZSTD-Plugin in some opensource project, I am very interested to take a look, may be even link to it. BTW, I just published v1.5.5-11 and it should land on maven central soon. |
Perfect, and that's exactly what we're doing! We'll be opening a pull request to qat-java in the coming days adding a " |
Opened intel/qat-java#12 if you'd like to follow along! |
@Coder-256 , looks that the use of ZSTD_generateSequences is deprecated in 1.5.6 and the comments suggest using ZSTD_compress instead. There is also another error in the same code:
|
I will comment out for the moment the sequences stuff |
Thanks. Anything related to the "builtin sequence producer" should be ok to comment out, it was only used for tests. It also seems that For reference, here's the relevant part of the diff in @@ -2765,7 +2818,7 @@ ZSTDLIB_STATIC_API size_t ZSTD_resetDStream(ZSTD_DStream* zds);
#define ZSTD_SEQUENCE_PRODUCER_ERROR ((size_t)(-1))
-typedef size_t ZSTD_sequenceProducer_F (
+typedef size_t (*ZSTD_sequenceProducer_F) (
void* sequenceProducerState,
ZSTD_Sequence* outSeqs, size_t outSeqsCapacity,
const void* src, size_t srcSize,
@@ -2797,7 +2850,23 @@ ZSTDLIB_STATIC_API void
ZSTD_registerSequenceProducer(
ZSTD_CCtx* cctx,
void* sequenceProducerState,
- ZSTD_sequenceProducer_F* sequenceProducer
+ ZSTD_sequenceProducer_F sequenceProducer
+); |
Thanks! I fixed the signatures and re-enabled it all and it passes tests. Compiles with a warning. I guess in the future we have to find how to stop using |
Hi,
Recently, @matt-000, @tparisi52 and I have been working with the Lehigh University Enterprise Systems Center on a project to implement Java bindings for QAT-ZSTD-Plugin, a library that accelerates zstd compression using Intel QuickAssist Technology (a hardware accelerator architecture). This PR adds support for the zstd sequence producer API introduced in zstd v1.5.4 (facebook/zstd#3333) and adds a basic test suite using a sequence producer based on
ZSTD_generateSequences()
.We also implemented support for a few more compression context configuration parameters, and improved support for zstd param switches (notably LDM is now configured as documented).
Thank you!