W. Felix Handte
66509c7bf4
Only Insert Positions Inside the Chain Window
2020-09-10 22:10:02 -04:00
W. Felix Handte
13c5ec3e41
Only Allow Dedicated Dict Search for Dicts Loaded in 1 Chunk
...
The load algorithm requires we do it all in one go.
2020-09-10 22:10:02 -04:00
Felix Handte
005ceaa052
Merge pull request #2276 from felixhandte/dedicated-dict-search-structure
...
DDSS For Lazy: Implement a Dedicated Dictionary Hash Table
2020-09-10 22:09:25 -04:00
W. Felix Handte
07793547e6
Fix Bug: Only Use DDSS Insertion on CDict MatchStates
...
Previously, if DDSS was enabled on a CCtx and a dictionary was inserted into
the CCtx, the CCtx MatchState would be filled as a DDSS struct, causing
segfaults etc. This changes the check to use whether the MatchState is marked
as using the DDSS (which is only ever set for CDict MatchStates), rather than
looking at the CCtxParams.
2020-09-10 18:51:52 -04:00
W. Felix Handte
d214d8c859
Shorten Dict Mode Conditionals in Order to Improve Readability
2020-09-10 18:51:52 -04:00
W. Felix Handte
f49c1563ff
Force-Inline ZSTD_insertAndFindFirstIndex_internal()
...
Without this, gcc was declining to inline the function in `ZSTD_noDict` mode,
resulting in a ~10% slowdown.
2020-09-10 18:51:52 -04:00
W. Felix Handte
cab86b074f
Clean Up Search Function Selection
2020-09-10 18:51:52 -04:00
W. Felix Handte
2ffbde0d95
Fix -Wshorten-64-to-32
Error
2020-09-10 18:51:52 -04:00
W. Felix Handte
7b5d2f72ea
Adjust Working Context Table Sizes Back Down
2020-09-10 18:51:52 -04:00
W. Felix Handte
c09454e28f
Add Warning Comment to ZSTD_createCDict_advanced2() Declaration
2020-09-10 18:51:52 -04:00
W. Felix Handte
d332f57897
Permit Matching Against Lowest Valid Position
...
This comparison was previously faulty: the lowest valid position is itself
valid, and we should therefore be allowed to match against it.
2020-09-10 18:51:52 -04:00
W. Felix Handte
a3659fe1ef
Make ZSTD_dedicatedDictSearch_getCParams Wrap ZSTD_getCParams
...
Fixes up bounds-checking, and lets us clean up what is at the moment an
unnecessary duplication of the default cparams tables.
2020-09-10 18:51:52 -04:00
W. Felix Handte
b81f3a37f9
Easy: Fix Test
2020-09-10 18:51:52 -04:00
W. Felix Handte
7b9a755ac9
Remove Chain Limit on Hash Cache Entries; Slightly Improve Compression
...
Entries in the hashTable chain cache aren't subject to the same aliasing that
the circular chain table is subject to. As such, we don't need to stop when we
cross the chain limit. We can delve deeper. :)
2020-09-10 18:51:52 -04:00
W. Felix Handte
e8b4011b52
Split Lookups in Hash Cache and Chain Table into Two Loops
...
Sliiiight speedup.
2020-09-10 18:51:52 -04:00
W. Felix Handte
9e83c782f8
Simplify DDS Hash Table Construction
...
No need to walk the chainTable; we can just keep shifting the entries in the
hashTable.
2020-09-10 18:51:52 -04:00
W. Felix Handte
ad9f98ac3f
Document the ZSTD_c_enableDedicatedDictSearch Parameter
2020-09-10 18:51:52 -04:00
W. Felix Handte
5390fee4f7
Rename and Move DD_BLOG Constant to ZSTD_LAZY_DDSS_BUCKET_LOG
2020-09-10 18:51:52 -04:00
W. Felix Handte
5e91ae27eb
Prefetch First Batch of Match Positions; +11% Speed in Level 5 w/ 1 Dict
2020-09-10 18:51:52 -04:00
W. Felix Handte
df386b3d8d
Fix Off-By-One Error in Counting DDS Search Attempts
...
This caused us to double-search the first position and fail to search the
last position in the chain, slowing down search and making it less effective.
2020-09-10 18:51:52 -04:00
W. Felix Handte
d46306087b
Enable Dedicated Dict Search in the CLI
2020-09-10 18:51:52 -04:00
W. Felix Handte
914bfe7ee4
Init CCtx's Local Dict with CCtxParams
2020-09-10 18:51:52 -04:00
W. Felix Handte
db2aa25252
Decision for Whether to Attach Should be Based on CDict Config, not CCtx
2020-09-10 18:51:52 -04:00
W. Felix Handte
a494111385
Move Prefetch Before Insertion; Speed Up ~6%
2020-09-10 18:51:52 -04:00
W. Felix Handte
eede46a47e
Misc Refactor of DDS Search Code
2020-09-10 18:51:52 -04:00
W. Felix Handte
f1b428fdac
Rename enableDedicatedDictSearch to dedicatedDictSearch in MatchState
...
This makes it clear that not only is the feature allowed here, we're actually
using it, as opposed to the CCtxParam field, in which it's enabled, but we may
or may not be using it.
2020-09-10 18:51:52 -04:00
W. Felix Handte
41012193ad
Always Init CDict's enableDedicatedDictSearch Field
2020-09-10 18:51:52 -04:00
W. Felix Handte
34b545acb0
Add a ZSTD_dedicatedDictSearch ZSTD_dictMode_e to Allow Const Propagation
...
Speed +1.5%.
2020-09-10 18:51:52 -04:00
W. Felix Handte
beefdb0d3d
Fix ZSTD_c_forceAttachDict Bounds
2020-09-10 18:51:52 -04:00
W. Felix Handte
c204110eff
Make ZSTD_c_enableDedicatedDictSearch an Experimental Param
2020-09-10 18:51:52 -04:00
W. Felix Handte
2cf6cfc55f
Add Fuzzer Test for the Various Dict Attachment Strategies
2020-09-10 18:51:52 -04:00
W. Felix Handte
ae4ebf6b8c
TODO: Comment
2020-09-10 18:51:52 -04:00
W. Felix Handte
def62e2d3e
Fix Compilation Warnings
2020-09-10 18:51:52 -04:00
Bimba Shrestha
80053bdae3
updating cold benchmark
2020-09-10 18:51:52 -04:00
Bimba Shrestha
9c628238d3
creating ZSTD_createCDict_advanced_internal
2020-09-10 18:51:52 -04:00
Bimba Shrestha
0a9787c3e1
changing to int for consistency
2020-09-10 18:51:52 -04:00
Bimba Shrestha
e29bc3a009
using dict mls instead of src mls
2020-09-10 18:51:52 -04:00
Bimba Shrestha
145c2d12f9
add hashtable head prefetching
2020-09-10 18:51:52 -04:00
Bimba Shrestha
5d5507788d
change method name for consistency
2020-09-10 18:51:52 -04:00
Bimba Shrestha
b30f71becf
pass correct cparams
2020-09-10 18:51:52 -04:00
Bimba Shrestha
a3f6e4026e
removing wrong comment
2020-09-10 18:51:52 -04:00
Bimba Shrestha
71fda0362f
making cctxParams a pointer
2020-09-10 18:51:52 -04:00
Bimba Shrestha
628559d0e4
loading dict using new algorithm
2020-09-10 18:51:52 -04:00
Bimba Shrestha
22705f0c93
adding dedicatedDictSearch algorithm
2020-09-10 18:51:52 -04:00
Bimba Shrestha
31e581bf65
adding enableDedicatedDictSearch to matchState_t
2020-09-10 18:51:52 -04:00
Bimba Shrestha
50550a14ad
adding dedicated dict load method to lazy
2020-09-10 18:51:52 -04:00
Bimba Shrestha
75b6360036
adding ZSTD_createCDict_advanced2 to zstd.h
2020-09-10 18:51:52 -04:00
Bimba Shrestha
b7dddbe89b
always attach dict when using dedicatedDictSearch
2020-09-10 18:51:52 -04:00
Bimba Shrestha
e36a373df4
adding dedicatedDictSearch cParams helper methods
2020-09-10 18:51:52 -04:00
Bimba Shrestha
f10d4e313c
adding ZSTD_dedicatedDictSearch_defaultCParameters variable
2020-09-10 18:51:52 -04:00