1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-04 14:48:45 +02:00
Commit Graph

331 Commits

Author SHA1 Message Date
2adde898c8 Fix typo with ZSTDMT_parameter 2017-08-25 16:13:40 -07:00
18224608ff Remove ZSTD_setCCtxParameter() 2017-08-25 13:58:41 -07:00
0744592d38 Add function initializing cctxParams from clevel 2017-08-25 13:36:47 -07:00
9911153723 Move jobSize and overlapLog in zstdmt to cctxParams 2017-08-25 13:14:51 -07:00
de5193422d Distinguish between jobParams and cctxParams in zstdmt 2017-08-25 11:36:17 -07:00
eb7bbab36a Remove ZSTD_p_refDictContent and dictContentByRef 2017-08-25 11:11:45 -07:00
db3f5372df [zstdmt] Use POOL_create_advanced() 2017-08-24 18:12:28 -07:00
2fbf0285b2 Fix interaction with ZSTD_setCCtxParameter() and cleanup 2017-08-24 11:25:41 -07:00
fd9bf42516 Fix forceWindow and dictMode setting for zstdmt jobs 2017-08-23 19:16:57 -07:00
bf3108fb50 Ensure zstdmt uses 'job version' of cctx parameters 2017-08-23 17:03:31 -07:00
6f1a21c7e9 Remove formatting-only changes 2017-08-23 10:24:19 -07:00
23fc0e41fa Remove 'opaque' naming from internal functions 2017-08-22 14:24:47 -07:00
8fd1636776 Remove unused functions 2017-08-22 13:33:58 -07:00
60e1bc617c Explicitly create a job cctxParam for multithreading 2017-08-21 15:39:37 -07:00
5b956f4753 Comment out CCtx_param versions of CDict functions 2017-08-21 14:49:16 -07:00
502031ca10 Use cctxParam version of createCDict internally 2017-08-21 11:00:44 -07:00
91b30dbe84 Remove test parameter 2017-08-21 10:09:06 -07:00
f181f33bdf Disable tests and refactor 2017-08-21 01:59:08 -07:00
023b24e6d4 Add cctx param tests 2017-08-20 22:55:07 -07:00
7db552676e reduced pool queue to 0 to save memory
fixed : pool performance when jobs are fires fast and queueSize==0
2017-08-19 15:07:54 -07:00
d775519296 Add cctxParam versions of internal functions 2017-08-18 17:37:58 -07:00
32fb407c9d updated a bunch of headers
for the new license
2017-08-18 16:52:05 -07:00
63b8c98531 Pass cctx parameters to MTCtx 2017-08-18 16:17:24 -07:00
b71363b967 check pthread_*_init() success condition 2017-07-19 01:05:40 -07:00
2bd6440be0 pinned down error code enum values
Note : all error codes are changed by this new version,
but it's expected to be the last change for existing codes.

Codes are now grouped by category, and receive a manually attributed value.
The objective is to guarantee that
error code values will not change in the future
when introducing new codes.
Intentionnal empty spaces and ranges are defined
in order to keep room for potential new codes.
2017-07-13 17:12:16 -07:00
3a60efd3a9 policy change : ZSTDMT automatically caps nbThreads to ZSTDMT_NBTHREADS_MAX (#760)
Previously, ZSTDMT would refuse to create the compressor.
Also : increased ZSTDMT_NBTHREADS_MAX to 256,
updated doc,
and added relevant test
2017-07-13 10:17:23 -07:00
132e6efd76 switched ZSTDMT_compress_advanced() last argument to overlapLog
overlapRLog (== 9 - overlapLog) was a bit "strange"
as all other public entry points use overlapLog
2017-07-13 02:22:58 -07:00
8ef666c325 slightly increased buffer pool, to cover normal "full load" scenarios
2 buffers per active worker
+ 1 buffer for input loading
+ 1 buffer for "next input" when submitting current one
+ 1 buffer stuck in queue
2017-07-12 14:23:34 -07:00
052a95f77c fix : ZSTDMT_compress_advanced() correctly generates checksum
when params.fParams.checksumFlag==1.
This use case used to be impossible when only ZSTD_compress() was available
2017-07-11 17:18:26 -07:00
2a62f48bf4 release input buffers from inside worker thread
buffers are released sooner, which makes them available faster for next job.
=> decreases total nb of buffers necessary
2017-07-11 15:56:40 -07:00
57236184af buffer pool : all buffers have same size
to reduce memory fragmentation.
They can be used for in or out, interchangeably.
2017-07-11 15:17:25 -07:00
34b2b95631 zstdmt : intermediate outBuffer allocated from within worker
reduces total amount of memory needed,
since jobs in queue do not have an outBuffer pre-reserved now
2017-07-11 14:59:10 -07:00
16261e6951 buffer pool can be invoked from multiple threads 2017-07-11 14:14:07 -07:00
ef0ff7fe7f zstdmt: removed margin for improved memory usage 2017-07-11 08:54:29 -07:00
4616fad18b improved ZSTDMT_compress() memory usage
does not need the input buffer for streaming operations

also : reduced a few tests time length
2017-07-10 17:16:41 -07:00
670b1fc547 optimized memory usage for ZSTDMT_compress()
Previously, each job would reserve a CCtx right before being posted.
The CCtx would be "part of the job description",
and only released when the job is completed (aka flushed).
For ZSTDMT_compress(), which creates all jobs first and only join at the end,
that meant one CCtx per job.
The nb of jobs used to be == nb of threads,
but since latest modification,
which reduces the size of jobs in order to spread the load of difficult areas,
it also increases the nb of jobs for large sources / small compression level.
This resulted in many more CCtx being created.

In this new version, CCtx are reserved within the worker thread.
It guaranteea there cannot be more CCtx reserved than workers (<= nb threads).

To do that, it required to make the CCtx Pool multi-threading-safe :
it can now be called from multiple threads in parallel.
2017-07-10 16:30:55 -07:00
3510efb02d fix : custom allocator correctly propagated to child contexts 2017-07-10 14:21:40 -07:00
e32fb0c1fe added ZSTD_sizeof_CCtx() test 2017-07-10 12:29:57 -07:00
27e883371d fixed wrong assert() condition
A single job created by ZSTDMT_compress() can be < 256KB
if data to compress is < 256 KB
(in which case it is delegated to single thread mode)
2017-07-04 19:33:16 -07:00
6383372dec fixed : 0-copy in NULL is UB 2017-07-04 10:36:41 -07:00
2de2396a36 refactor ZSTDMT_compress() 2017-07-03 16:23:36 -07:00
2084b041f4 fixed comments 2017-07-03 15:52:19 -07:00
1bafe393e4 fix : ZSTDMT_compressStream_generic() can accept NULL input
also : converge implementations towards new version of ZSTDMT_compressStream_generic()
2017-07-01 06:59:24 -07:00
58bd0e70fc fixed : dictionary compression with new advanced API in Multi-threading mode 2017-06-30 16:01:02 -07:00
d8b33a598d Optimized ZSTDMT single-pass mode speed on large sources
by ensuring job sizes remain "not too large"
2017-06-30 15:44:57 -07:00
d5c046c609 implemented shortcut for zstd_compress_generic() in MT mode
added ZSTDMT_compress_advanced() API
2017-06-30 14:51:01 -07:00
33a6639039 fixed ZSTD_refPrefix with Multithread-enabled CCtx 2017-06-28 11:09:43 -07:00
204b6b7ef6 fixed streaming buffered allocation with CDict compression 2017-06-21 15:13:00 -07:00
83095970e6 free cdictLocal faster, suggested by @terrelln 2017-06-21 12:26:40 -07:00
7bd1a2900e added ZSTD_dictMode_e to control dictionary loading mode 2017-06-21 11:50:33 -07:00