Skip to content
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

[pull] master from erlang:master #252

Merged
merged 6 commits into from
Mar 20, 2025
Merged

[pull] master from erlang:master #252

merged 6 commits into from
Mar 20, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Mar 20, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

jhogberg and others added 6 commits March 13, 2025 10:05
The +R flag has not been used since 2012, so we remove it
from the docs but keep it in the code in case we ever need
to use it again in the future.
…rapper-include

erts: Fix missing include of dtrace-wrapper.h
…19551

erts: Remove +R from documentation
@pull pull bot added the ⤵️ pull label Mar 20, 2025
@pull pull bot merged commit 1fb3bde into garazdawi:master Mar 20, 2025
Copy link

sourcery-ai bot commented Mar 20, 2025

Reviewer's Guide by Sourcery

This pull request introduces several performance improvements and new features to the Zstandard compression library. It includes changes to the block splitter logic, the addition of a new function for compressing sequences and literals, and updates to the handling of external sequences. It also renames some variables and functions for clarity and consistency.

Updated class diagram for ZSTD_CCtx

classDiagram
  class ZSTD_CCtx {
    -POOL_ctx* factory
    -ZSTD_customMem cMem
    -ZSTD_CCtx_params params
    -const ZSTD_CDict* cdict
    -ZSTD_CDict* cdictLocal
    -unsigned long long frameContentSize
    -size_t targetSectionSize
    -size_t targetPrefixSize
    -int jobReady
    -inBuff_t inBuff
    -roundBuff_t roundBuff
    -serialState_t serial
    -rsyncState_t rsync
    -unsigned jobIDMask
    -unsigned doneJobID
    -unsigned nextJobID
    -ZSTD_pthread_mutex_t jobCounterMutex
    -ZSTD_pthread_cond_t jobCounterCond
    -int nbJobsLaunched
    -int nbJobsCompleted
    -int allJobsCompleted
    -ZSTDMT_jobDescription* jobs
    -size_t consumed
    -size_t produced
    -int streamEnd
    -int checksumState
    -U32 checksum
  }
  class inBuff_t {
    -range_t prefix
    -buffer_t buffer
    -size_t filled
  }
  class range_t {
    -void const* start
    -size_t size
  }
  class buffer_t {
    -void* start
    -size_t capacity
  }
  class roundBuff_t {
    -BYTE* buffer
    -size_t capacity
    -size_t pos
  }
  class serialState_t {
    -ZSTD_pthread_mutex_t mutex
    -ZSTD_pthread_cond_t cond
    -ZSTD_CCtx_params params
    -size_t jobSize
    -ldmState_t ldmState
    -unsigned nextJobID
  }
  class ldmState_t {
    -ZSTD_paramSwitch_e enableLdm
    -U32 hashLog
    -U32 bucketSizeLog
    -U32 minMatchLength
    -U32 hashRateLog
    -U32 lowComplexityLog
    -U32* bucketOffsets
    -ZSTD_window_t window
  }
  class ZSTD_window_t {
    -BYTE* base
    -U32 lowLimit
    -U32 dictLimit
    -U32 nextSrc
    -U32 current
    -BYTE* dictBase
  }
  class rsyncState_t {
    -U64 hash
    -U64 hitMask
    -U64 primePower
  }

  ZSTD_CCtx -- inBuff_t : has
  inBuff_t -- range_t : has
  inBuff_t -- buffer_t : has
  ZSTD_CCtx -- roundBuff_t : has
  ZSTD_CCtx -- serialState_t : has
  serialState_t -- ldmState_t : has
  ldmState_t -- ZSTD_window_t : has
  ZSTD_CCtx -- rsyncState_t : has

  note for ZSTD_CCtx "Manages compression context and parameters for multi-threaded compression."
  note for inBuff_t "Input buffer management for compression jobs."
  note for roundBuff_t "Round buffer for managing input data in a circular manner."
  note for serialState_t "Serial state for managing LDM and other serial operations."
  note for ldmState_t "Long Distance Matching state for improving compression ratio."
  note for ZSTD_window_t "Window state for managing the compression history."
  note for rsyncState_t "State for rsync algorithm to find synchronization points."
Loading

File-Level Changes

Change Details Files
Renamed ZSTD_paramSwitch_e to ZSTD_ParamSwitch_e and updated related code.
  • Renamed ZSTD_paramSwitch_e to ZSTD_ParamSwitch_e.
  • Updated usages of the enum to reflect the name change.
erts/emulator/zstd/compress/zstd_compress.c
erts/emulator/zstd/erl_zstd.h
Replaced entropyWorkspace with tmpWorkspace in ZSTD_CCtx and updated related code.
  • Replaced entropyWorkspace with tmpWorkspace in ZSTD_CCtx.
  • Updated usages of the workspace to reflect the name change.
  • Added tmpWkspSize to ZSTD_CCtx to store the size of the temporary workspace.
erts/emulator/zstd/compress/zstd_compress.c
Added a new function ZSTD_compressSequencesAndLiterals and related functions to compress sequences and literals.
  • Added ZSTD_compressSequencesAndLiterals function.
  • Added ZSTD_compressSequencesAndLiterals_internal function.
  • Added ZSTD_convertBlockSequences function.
  • Added ZSTD_get1BlockSummary function.
  • Added convertSequences_noRepcodes function.
  • Added ZSTD_transferSequences_noDelim function.
erts/emulator/zstd/compress/zstd_compress.c
erts/emulator/zstd/erl_zstd.h
Added a new parameter ZSTD_c_blockSplitterLevel to control the first splitter stage.
  • Added ZSTD_c_blockSplitterLevel enum value to ZSTD_cParameter.
  • Added preBlockSplitter_level field to ZSTD_CCtx_params.
  • Updated ZSTD_CCtxParams_setParameter and ZSTD_CCtxParams_getParameter to handle the new parameter.
  • Updated ZSTD_estimateCCtxSize_usingCCtxParams_internal to account for the new parameter.
erts/emulator/zstd/compress/zstd_compress.c
erts/emulator/zstd/erl_zstd.h
Modified block splitter logic to use a pre-splitter and a post-splitter.
  • Replaced useBlockSplitter with postBlockSplitter in ZSTD_CCtx_params.
  • Added preBlockSplitter_level to ZSTD_CCtx_params.
  • Updated ZSTD_CCtxParams_setParameter and ZSTD_CCtxParams_getParameter to handle the new parameters.
  • Modified ZSTD_compressBlock_splitBlock to use the new splitter logic.
  • Added ZSTD_optimalBlockSize function to determine the optimal block size based on the split level.
erts/emulator/zstd/compress/zstd_compress.c
erts/emulator/zstd/erl_zstd.h
Added a new function ZSTD_transferSequences_wBlockDelim to transfer sequences with block delimiters.
  • Added ZSTD_transferSequences_wBlockDelim function.
  • Updated ZSTD_buildSeqStore to use the new function when external sequences are enabled.
erts/emulator/zstd/compress/zstd_compress.c
Renamed useBlockSplitter to postBlockSplitter and updated related code.
  • Renamed useBlockSplitter to postBlockSplitter.
  • Updated usages of the variable to reflect the name change.
erts/emulator/zstd/compress/zstd_compress.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants