git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/4] Add a compile-time option to use the new, very fast sha1dc Rust crate

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 28, 2026, 15:51 UTC
Message-ID
<pull.2240.git.1790610691.gitgitgadget@gmail.com>

I stumbled across this new Rust crate last week. Its performance numbers are quite impressive. Naturally, I want to make use of this and get for Windows, which is used on many monorepos where this makes a real difference: In a pretty fast and loose test, I verified that a git index-pack runs roughly three times faster solely due to using those SIMD-based optimizations!

As a safety precaution, because this sha1dc crate is quite new, I wanted to introduce an escape hatch: core.sha1dcBackend=c, but turn it on by default, which is the reason for the three additional patches. Should these patches be undesirable for the Git project? I would not be mad at all if they were simply dropped.

Johannes Schindelin (4):
  libgitcore: add `sha1dc` as an optional feature
  sha1dc: allow selecting the C backend without rebuilding
  pthread: provide `pthread_once()` shims for Windows and for
    NO_PTHREADS
  sha1dc: make `sha1dc_init()` thread-safe
 Cargo.toml                     |   4 ++
 Documentation/config/core.adoc |   5 ++
 Makefile                       |  29 +++++++++
 compat/win32/pthread.c         |  16 +++++
 compat/win32/pthread.h         |   5 ++
 hash.h                         |   5 ++
 sha1dc_git.c                   | 109 +++++++++++++++++++++++++++++++--
 sha1dc_git.h                   |   5 +-
 sha1dc_rs.h                    |  37 +++++++++++
 src/lib.rs                     |   2 +
 src/sha1dc_rs.rs               |  78 +++++++++++++++++++++++
 t/helper/test-sha1.c           |  19 +++++-
 t/t0013-sha1dc.sh              |  21 ++++++-
 thread-utils.h                 |  16 +++++
 14 files changed, 343 insertions(+), 8 deletions(-)
 create mode 100644 sha1dc_rs.h
 create mode 100644 src/sha1dc_rs.rs
base-commit: 3bc0341126508f78f5869cbfc0005e987efdf0c7
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2240%2Fdscho%2Foptionally-use-sha1dc-rs-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2240/dscho/optionally-use-sha1dc-rs-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2240
-- 
gitgitgadget
Next: Johannes Schindelin via GitGitGadget
Message 1 of 9 in “Add a compile-time option to use the new, very fast sha1dc Rust crate”
  1. 0/4 Add a compile-time option to use the new, very fast sha1dc Rust crateJohannes Schindelin via GitGitGadget, Sep 28, 2026
  2. 1/4 libgitcore: add `sha1dc` as an optional featureJohannes Schindelin via GitGitGadget, Sep 28, 2026
  3. brian m. carlsonOct 3, 2026
  4. 2/4 sha1dc: allow selecting the C backend without rebuildingJohannes Schindelin via GitGitGadget, Sep 28, 2026
  5. 3/4 pthread: provide `pthread_once()` shims for Windows and for NO_PTHREADSJohannes Schindelin via GitGitGadget, Sep 28, 2026
  6. 4/4 sha1dc: make `sha1dc_init()` thread-safeJohannes Schindelin via GitGitGadget, Sep 28, 2026
  7. Johannes SchindelinSep 28, 2026
  8. Junio C HamanoSep 29, 2026
  9. Johannes SchindelinOct 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.