Skip to content
Snippets Groups Projects
Select Git revision
  • next protected
  • seen protected
  • jt/null-term-missing-objects
  • b4/493-add-command-to-purge-reflog-entries
  • b4/toon-zlib-git-version
  • b4/pks-objects-without-the-repository
  • todo protected
  • master default protected
  • b4/pks-update-ref-optimization
  • b4/pks-ci-meson-vsenv
  • b4/pks-maintenance-reflog-expire
  • b4/245-partially-atomic-ref-updates
  • cc-export-signed-commits
  • pks-split-object-file
  • b4/506-refactor-object-file-c-to-not-depend-on-global-state
  • b4/pks-meson-cross-compilation
  • jt/diff-blob
  • toon-blame-tree
  • b4/pks-cat-file-object-type-filter
  • b4/pks-gitlab-ci-fix-msvc-meson-tests
  • v2.49.0-rc1 protected
  • v2.49.0-rc0 protected
  • v2.48.1.gl1 protected
  • v2.48.1 protected
  • v2.48.0 protected
  • v2.48.0-rc2 protected
  • v2.48.0-rc1 protected
  • v2.46.3 protected
  • v2.40.4 protected
  • v2.41.3 protected
  • v2.42.4 protected
  • v2.43.6 protected
  • v2.44.3 protected
  • v2.45.3 protected
  • v2.47.2 protected
  • v2.48.0-rc0 protected
  • v2.47.1 protected
  • v2.47.0 protected
  • v2.47.0-rc1 protected
  • v2.47.0-rc0 protected
40 results

git

  • Clone with SSH
  • Clone with HTTPS
  • Patrick Steinhardt's avatar
    Patrick Steinhardt authored
    The zlib-ng library is a hard fork of the old and venerable zlib
    library. It describes itself as zlib replacement with optimizations for
    "next generation" systems. As such, it contains several implementations
    of central algorithms using for example SSE2, AVX2 and other vectorized
    CPU intrinsics that supposedly speed up in- and deflating data.
    
    And indeed, compiling Git against zlib-ng leads to a significant speedup
    when reading objects. The following benchmark uses git-cat-file(1) with
    `--batch --batch-all-objects` in the Git repository:
    
        Benchmark 1: zlib
          Time (mean ± σ):     52.085 s ±  0.141 s    [User: 51.500 s, System: 0.456 s]
          Range (min … max):   52.004 s … 52.335 s    5 runs
    
        Benchmark 2: zlib-ng
          Time (mean ± σ):     40.324 s ±  0.134 s    [User: 39.731 s, System: 0.490 s]
          Range (min … max):   40.135 s … 40.484 s    5 runs
    
        Summary
          zlib-ng ran
            1.29 ± 0.01 times faster than zlib
    
    So we're looking at a ~25% speedup compared to zlib. This is of course
    an extreme example, as it makes us read through all objects in the
    repository. But regardless, it should be possible to see some sort of
    speedup in most commands that end up accessing the object database.
    
    The zlib-ng library provides a compatibility layer that makes it a
    proper drop-in replacement for zlib: nothing needs to change in the
    build system to support it. Unfortunately though, this mode isn't easy
    to use on most systems because distributions do not allow you to install
    zlib-ng in that way, as that would mean that the zlib library would be
    globally replaced. Instead, many distributions provide a package that
    installs zlib-ng without the compatibility layer. This version does
    provide effectively the same APIs like zlib does, but all of the symbols
    are prefixed with `zng_` to avoid symbol collisions.
    
    Implement a new build option that allows us to link against zlib-ng
    directly. If set, we redefine zlib symbols so that we use the `zng_`
    prefixed versions thereof provided by that library. Like this, it
    becomes possible to install both zlib and zlib-ng (without the compat
    layer) and then pick whichever library one wants to link against for
    Git.
    
    Signed-off-by: default avatarPatrick Steinhardt <ps@pks.im>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b9d6f643
    History
    Name Last commit Last update