1. 02 Feb, 2023 1 commit
  2. 12 Jul, 2022 4 commits
  3. 04 Jul, 2022 1 commit
  4. 31 Dec, 2021 1 commit
  5. 23 Dec, 2021 1 commit
    • cmake: use PROJECT_SOURCE_DIR of CMAKE_SOURCE_DIR · c5cd71b2
      Also applies to *_BINARY_DIR.
      
      This effectively reverts 84083dcc,
      which broke all users of libgit2 that use it as a CMake subdirectory
      (via `add_subdirectory()`). This is because CMAKE_SOURCE_DIR refers
      to the root-most CMake directory, which in the case of
      `add_subdirectory()` is a parent project to libgit2 and thus the paths
      don't make any sense to the configuration files. Corollary,
      CMAKE_SOURCE_DIR only makes sense if the CMake project is always the
      root project - which can rarely be guaranteed.
      
      In all honesty, CMake should deprecate and eventually remove
      CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. It's been the source of headaches
      and confusion for years, they're rarely useful over
      CMAKE_CURRENT_(SOURCE|BINARY)_DIR or PROJECT_(SOURCE|BINARY)_DIR,
      and they cause a lot of confusing configuration and source
      code layouts to boot.
      
      Any time they are used, they break `add_subdirectory()` almost 100% of
      the time, cause confusing error messages, and hide subtle bugs.
      Josh Junon committed
  6. 22 Nov, 2021 1 commit
  7. 15 Nov, 2021 1 commit
  8. 19 Oct, 2021 1 commit
  9. 18 Oct, 2021 1 commit
  10. 24 Aug, 2021 1 commit
  11. 24 Dec, 2020 1 commit
    • zlib: Add support for building with Chromium's zlib implementation · 83265b3e
      This change builds libgit2 using Chromium's zlib implementation by
      invoking cmake with `-DUSE_BUNDLED_ZLIB=ON -DUSE_CHROMIUM_ZLIB=ON`,
      which is ~10% faster than the bundled zlib for the core::zstream suite.
      
      This version of zlib has some optimizations:
      
      a) Decompression (Intel+ARM): inflate_fast, adler32, crc32, etc.
      b) Compression (Intel): fill_window, longest_match, hash function, etc.
      
      Due to the introduction of SIMD optimizations, and to get the maximum
      performance out of this fork of zlib, this requires an x86_64 processor
      with SSE4.2 and CLMUL (anything Westmere or later, ~2010). The Chromium
      zlib implementation also supports ARM with NEON, but it has not been
      enabled in this patch.
      
      Performance
      ===========
      
      TL;DR: Running just `./libgit2_clar -score::zstream` 100 times in a loop
      took 0:56.30 before and 0:50.67 after (~10% reduction!).
      
      The bundled and system zlib implementations on an Ubuntu Focal system
      perform relatively similar (the bundled one is marginally better due to
      the compiler being able to inline some functions), so only the bundled
      and Chromium zlibs were compared.
      
      For a more balanced comparison (to ensure that nothing regressed
      overall), `libgit2_clar` under `perf` was also run, and the zlib-related
      functions were compared.
      
      Bundled
      -------
      
      ```shell
      cmake \
        -DUSE_BUNDLED_ZLIB=ON \
        -DUSE_CHROMIUM_ZLIB=OFF \
        -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
        -DCMAKE_C_FLAGS="-fPIC -fno-omit-frame-pointer" \
        -GNinja \
        ..
      ninja
      perf record --call-graph=dwarf ./libgit2_clar
      perf report --children
      ```
      
      ```
      Samples: 87K of event 'cycles', Event count (approx.): 75923450603
        Children      Self  Command       Shared Objec  Symbol
      +    4.14%     0.01%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output_chunk
      +    2.91%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output
      +    0.69%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output (inlined)
           0.17%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_init
           0.02%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_reset
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_eos
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_done
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_free (inlined)
      
      Samples: 87K of event 'cycles', Event count (approx.): 75923450603
        Children      Self  Command       Shared Objec  Symbol
      +    3.12%     0.01%  libgit2_clar  libgit2_clar  [.] deflate
      +    2.65%     1.48%  libgit2_clar  libgit2_clar  [.] deflate_slow
      +    1.60%     0.55%  libgit2_clar  libgit2_clar  [.] inflate
      +    0.53%     0.00%  libgit2_clar  libgit2_clar  [.] write_deflate
           0.49%     0.36%  libgit2_clar  libgit2_clar  [.] inflate_fast
           0.46%     0.02%  libgit2_clar  libgit2_clar  [.] deflate_fast
           0.19%     0.19%  libgit2_clar  libgit2_clar  [.] inflate_table
           0.16%     0.01%  libgit2_clar  libgit2_clar  [.] inflateInit_
           0.15%     0.00%  libgit2_clar  libgit2_clar  [.] inflateInit2_ (inlined)
           0.10%     0.00%  libgit2_clar  libgit2_clar  [.] deflateInit_
           0.10%     0.00%  libgit2_clar  libgit2_clar  [.] deflateInit2_
           0.03%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset (inlined)
           0.02%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset
           0.02%     0.00%  libgit2_clar  libgit2_clar  [.] inflateEnd
           0.02%     0.00%  libgit2_clar  libgit2_clar  [.] deflateEnd
           0.01%     0.00%  libgit2_clar  libgit2_clar  [.] deflateResetKeep
           0.01%     0.01%  libgit2_clar  libgit2_clar  [.] inflateReset2
           0.01%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateReset (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] deflateStateCheck (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateResetKeep (inlined)
      ```
      
      Chromium
      --------
      
      ```shell
      cmake \
        -DUSE_BUNDLED_ZLIB=ON \
        -DUSE_CHROMIUM_ZLIB=ON \
        -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
        -DCMAKE_C_FLAGS="-fPIC -fno-omit-frame-pointer" \
        -GNinja \
        ..
      ninja
      perf record --call-graph=dwarf ./libgit2_clar
      perf report --children
      ```
      
      ```
      Samples: 97K of event 'cycles', Event count (approx.): 80862210917
        Children      Self  Command       Shared Objec  Symbol
      +    3.31%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output_chunk
      +    2.27%     0.01%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output
      +    0.55%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_get_output (inlined)
           0.18%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_init
           0.02%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_reset
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_free (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_done
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] git_zstream_free
      
      Samples: 97K of event 'cycles', Event count (approx.): 80862210917
        Children      Self  Command       Shared Objec  Symbol
      +    2.55%     0.01%  libgit2_clar  libgit2_clar  [.] deflate
      +    2.25%     1.41%  libgit2_clar  libgit2_clar  [.] deflate_slow
      +    1.10%     0.52%  libgit2_clar  libgit2_clar  [.] inflate
           0.36%     0.00%  libgit2_clar  libgit2_clar  [.] write_deflate
           0.30%     0.03%  libgit2_clar  libgit2_clar  [.] deflate_fast
           0.28%     0.15%  libgit2_clar  libgit2_clar  [.] inflate_fast_chunk_
           0.19%     0.19%  libgit2_clar  libgit2_clar  [.] inflate_table
           0.17%     0.01%  libgit2_clar  libgit2_clar  [.] inflateInit_
           0.16%     0.00%  libgit2_clar  libgit2_clar  [.] inflateInit2_ (inlined)
           0.15%     0.00%  libgit2_clar  libgit2_clar  [.] deflateInit_
           0.15%     0.00%  libgit2_clar  libgit2_clar  [.] deflateInit2_
           0.11%     0.01%  libgit2_clar  libgit2_clar  [.] adler32_z
           0.09%     0.09%  libgit2_clar  libgit2_clar  [.] adler32_simd_
           0.05%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset (inlined)
           0.05%     0.00%  libgit2_clar  libgit2_clar  [.] deflate_read_buf
           0.03%     0.00%  libgit2_clar  libgit2_clar  [.] inflateEnd
           0.02%     0.00%  libgit2_clar  libgit2_clar  [.] deflateReset
           0.01%     0.00%  libgit2_clar  libgit2_clar  [.] deflateEnd
           0.01%     0.01%  libgit2_clar  libgit2_clar  [.] inflateReset2
           0.01%     0.00%  libgit2_clar  libgit2_clar  [.] inflateReset (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] adler32
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateResetKeep (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] deflateResetKeep
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] inflateStateCheck (inlined)
           0.00%     0.00%  libgit2_clar  libgit2_clar  [.] deflateStateCheck (inlined)
      ```
      lhchavez committed
  12. 20 Oct, 2020 1 commit
  13. 11 Oct, 2020 1 commit
  14. 04 Oct, 2020 3 commits
  15. 21 Aug, 2020 2 commits
  16. 30 Jun, 2020 2 commits
  17. 15 May, 2020 1 commit
    • cmake: Sort source files for reproducible builds · b85eefb4
      We currently use `FILE(GLOB ...)` in most places to find source and
      header files. This is problematic in that the order of files returned
      depends on the operating system's directory iteration order and may thus
      not be deterministic. As a result, we link object files in unspecified
      order, which may cause the linker to emit different code across runs.
      
      Fix this issue by sorting all code used as input to the libgit2 library
      to improve the reliability of reproducible builds.
      Patrick Steinhardt committed
  18. 05 Apr, 2020 1 commit
  19. 01 Apr, 2020 1 commit
  20. 13 Mar, 2020 1 commit
  21. 26 Feb, 2020 1 commit
    • deps: ntlmclient: fix htonll on big endian FreeBSD · c690136c
      In commit 3828ea67 (deps: ntlmclient: fix missing htonll symbols on
      FreeBSD and SunOS, 2020-02-21), we've fixed compilation on BSDs due to
      missing `htonll` wrappers. While we are now using `htobe64` for both
      Linux and OpenBSD, we decided to use `bswap64` on FreeBSD. While correct
      on little endian systems, where we will swap from little- to big-endian,
      we will also do the swap on big endian systems. As a result, we do not
      use network byte order on such systems.
      
      Fix the issue by using htobe64, as well.
      Patrick Steinhardt committed
  22. 24 Feb, 2020 1 commit
  23. 09 Jan, 2020 1 commit
  24. 29 Aug, 2019 1 commit
  25. 24 Jun, 2019 2 commits
  26. 14 Jun, 2019 1 commit
  27. 11 Jun, 2019 1 commit
  28. 10 Jun, 2019 1 commit
  29. 22 May, 2019 1 commit
  30. 19 May, 2019 2 commits
  31. 06 Jan, 2019 1 commit