summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | zlib: Add support for building with Chromium's zlib implementationlhchavez2020-12-233-4/+113
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) ```
* | | Merge pull request #5741 from libgit2/ethomson/ipv6Edward Thomson2020-12-235-40/+469
|\ \ \ | | | | | | | | Handle ipv6 addresses
| * | | net: function to identify ipv6 addresses in URLsEdward Thomson2020-12-232-0/+8
| | | |
| * | | net: is_default_port is a boolEdward Thomson2020-12-232-3/+3
| | | |
| * | | winhttp: handle ipv6 addressesEdward Thomson2020-12-231-15/+27
| | | |
| * | | http: handle ipv6 addressesEdward Thomson2020-12-231-10/+30
| | | |
| * | | urlparse: use consistent ipv6 address rulesEdward Thomson2020-12-231-230/+109
| | | | | | | | | | | | | | | | | | | | | | | | IPv6 addresses should be used identically internally; we should not denote them with brackets in one operating system and without them in another.
| * | | urlparse: Add IPv4 and IPv6 based testsPaul Wolfgang (DC-AE/ESF1)2020-12-231-0/+510
| | | |
* | | | Merge pull request #5750 from arroz/missing_hostkey_typesEdward Thomson2020-12-233-3/+29
|\ \ \ \ | |/ / / |/| | | Add support for additional SSH hostkey types.
| * | | Change libssh2 version to 1.9.0 on focalMiguel Arroz2020-12-211-3/+3
| | | |
| * | | Wrap newer hostkeys in #ifdefsMiguel Arroz2020-12-211-0/+6
| | | | | | | | | | | | | | | | This allows the library to be built using a pre-1.9.0 version of libssh2.
| * | | Add support for additional hostkey types.Miguel Arroz2020-12-212-0/+20
| | | | | | | | | | | | | | | | Specifically: ECDSA_256, ECDSA_384, ECDSA_521 and ED25519.
* | | | Merge pull request #5749 from lhchavez/gcc-10Edward Thomson2020-12-233-8/+12
|\ \ \ \ | |/ / / |/| | | Fix the `-DENABLE_WERROR=ON` build for gcc 10.2
| * | | Fix the `-DENABLE_WERROR=ON` build for gcc 10.2lhchavez2020-12-213-8/+12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes it possible to build with newer versions of gcc without warnings. There were two warnings issued: * gcc 8 added [`-Wstringop-truncation`](https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/), which warns if a call to `strncpy(3)` is prone to accidentally truncating the destination string, since `strncpy(3)` does NOT add a terminating `NULL` if the destination buffer is not large enough to hold the input. This change uses the pattern suggested in https://us-cert.cisa.gov/bsi/articles/knowledge/coding-practices/strncpy-and-strncat to fix the locations flagged by gcc. * There was a potentially uninitialized access of `dest` in `fs_copy`.
* | | Merge pull request #5746 from libgit2/ethomson/configmapcacheEdward Thomson2020-12-202-6/+9
|\ \ \ | | | | | | | | repository: use intptr_t's in the config map cache
| * | | config_cache: cleanup config map lookupEdward Thomson2020-12-201-5/+8
| | | |
| * | | repository: use intptr_t's in the config map cacheethomson/configmapcacheEdward Thomson2020-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since we're using atomic primitives to read and write into the config map cache, we need to read/write something pointer-sized. Use an `intptr_t` for the config map cache.
* | | | Merge pull request #5744 from ↵Edward Thomson2020-12-203-5/+292
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | lhchavez/last-multiply-int64-overflow-change-i-swear Add tests for `git__multiply_int64_overflow`
| * | | | Add tests for `git__multiply_int64_overflow`lhchavez2020-12-193-5/+292
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it turns out, the implementation of `git__multiply_int64_overflow` is full of edge cases and tricky arithmetic. That means that it should have unit tests. As a result, a bug in `git__strntol64` was found (and fixed!) in clang+32-bit.
* | | | Merge pull request #5743 from lhchavez/fix-clang-32-bit-testsEdward Thomson2020-12-191-4/+11
|\ \ \ \ | | | | | | | | | | Third attempt to fix the 32-bit version of `git__multiply_int64_overf…
| * | | | Third attempt to fix the 32-bit version of `git__multiply_int64_overflow`lhchavez2020-12-181-4/+11
|/ / / / | | | | | | | | | | | | | | | | | | | | This change should now fix the issue for realsies. `./libgit2_clar -score::strtol` passes on a 32-bit Docker.
* | | | Merge pull request #5742 from lhchavez/fix-clang-32-bit-buildEdward Thomson2020-12-181-3/+10
|\ \ \ \ | | | | | | | | | | Avoid using `__builtin_mul_overflow` with the clang+32-bit combo
| * | | | Avoid using `__builtin_mul_overflow` with the clang+32-bit combolhchavez2020-12-181-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This causes clang to produce an undefined reference to `__mulodi4`. This could be fixed by statically linking some compiler-rt libraries to provide this symbol, but let's first stop the bleeding since doing the correct long-term fix requires some non-trivial CMake knowledge which I lack.
* | | | | ci: only run codeql nightlyEdward Thomson2020-12-181-4/+1
|/ / / /
* | | | Merge pull request #5709 from libgit2/ethomson/codeqlEdward Thomson2020-12-161-0/+39
|\ \ \ \ | |/ / / |/| | | ci: run codeql
| * | | ci: run codeqlethomson/codeqlEdward Thomson2020-12-161-0/+39
|/ / /
* | | Merge pull request #5740 from libgit2/ethomson/zlibEdward Thomson2020-12-161-4/+9
|\ \ \ | | | | | | | | pack: continue zlib while we can make progress
| * | | pack: continue zlib while we can make progressethomson/zlibEdward Thomson2020-12-151-4/+9
| |/ / | | | | | | | | | | | | Continue the zlib stream as long as we can make progress; stop when we stop getting output _or_ when zlib stops taking input from us.
* | | Merge pull request #4418 from libgit2/cmn/rc4Edward Thomson2020-12-141-7/+2
|\ \ \ | | | | | | | | Re-enable the RC4 test
| * | | badssl: RC4 should not fail with ECERTIFICATEcmn/rc4Edward Thomson2020-12-141-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | Using RC4 is not a _certificate_ problem, it's a cipher problem. The SSL implementation should and will fail with an unrecoverable error (-1). There's no opportunity to accept/continue.
| * | | badssl: re-enable RC4 testCarlos Martín Nieto2020-12-131-3/+0
|/ / / | | | | | | | | | | | | | | | This used to fail with an error indicating a mis-use of OpenSSL on platforms using it due to poor error handling. Re-enable it even if this isn't the right error code to use for now.
* | | Merge pull request #5727 from lhchavez/make-git-diff-fastEdward Thomson2020-12-134-33/+76
|\ \ \ | | | | | | | | Cache the parsed submodule config when diffing
| * | | Fix an oopslhchavez2020-12-111-1/+1
| | | |
| * | | Small refactor to make thing tidierlhchavez2020-12-114-43/+46
| | | | | | | | | | | | | | | | Also repurposed an unused function and deleted another one.
| * | | Cache the parsed submodule config when diffinglhchavez2020-12-103-8/+48
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes that anything that calls `git_diff__from_iterators` (any of the `git_diff_xxx` functions) only need to parse the `.gitmodules` file once. This can be avoided by calling `git_repository_submodule_cache_all(...)`, but we can do that safely for the user with no change in semantics. Fixes: #5725
* | | Merge pull request #5735 from lhchavez/faster-strntol64Edward Thomson2020-12-132-11/+34
|\ \ \ | | | | | | | | Make git__strntol64() ~70%* faster
| * | | Make git__strntol64() ~70%* fasterlhchavez2020-12-122-11/+34
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change uses compiler intrinsics to detect overflows instead of using divisions to detect potential overflow. This makes the code faster and makes it easier to read as a bonus side-effect! Some of the things this quickens: * Config parsing. * Tree parsing. * Smart protocol negotiation. \* Measured by running `libgit2_clar` with `-fno-optimize-sibling-calls -fno-omit-frame-pointer` under `perf(1)`: ```shell $ perf diff --symbols=git__strntol64 --compute=ratio \ --percentage=absolute baseline.data perf.data \# Event 'cycles' \# \# Baseline Ratio Shared Object \# ........ .............. ............. \# 0.25% 0.321836 libgit2_clar ```
* | | Merge pull request #5384 from ianhattendorf/fix/winhttp-client-certEdward Thomson2020-12-131-26/+49
|\ \ \ | | | | | | | | winhttp: support optional client cert
| * | | winhttp: clarify invalid cert caseIan Hattendorf2020-06-241-1/+1
| | | |
| * | | winhttp: variable and switch case scopingIan Hattendorf2020-02-061-9/+6
| | | |
| * | | winhttp: support optional client certIan Hattendorf2020-02-041-26/+52
| | | |
* | | | README: show v1.1 build statusEdward Thomson2020-12-131-1/+1
| |/ / |/| |
* | | Merge pull request #5724 from vringar/patch-2Edward Thomson2020-12-091-2/+2
|\ \ \ | | | | | | | | git.git-authors: Replacing his/her with their
| * | | git.git-authors: Replacing his/her with theirStefan Zabka2020-12-091-2/+2
|/ / /
* | | Merge pull request #5578 from libgit2/ethomson/friendlier_getting_startedEdward Thomson2020-12-098-4/+172
|\ \ \ | | | | | | | | Friendlier getting started in the lack of git_libgit2_init
| * | | alloc: set up an allocator that fails before library initEdward Thomson2020-12-094-4/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We require the library to be initialized with git_libgit2_init before it is functional. However, if a user tries to uses the library without doing so - as they might when getting started with the library for the first time - we will likely crash. This commit introduces some guard rails - now instead of having _no_ allocator by default, we'll have an allocator that always fails, and never tries to set an error message (since the thread-local state is set up by git_libgit2_init). We've modified the error retrieval function to (try to) ensure that the library has been initialized before getting the thread-local error message. (Unfortunately, we cannot determine if the thread local storage has actually been configured, this does require initialization by git_libgit2_init. But a naive attempt should be good enough for most cases.)
| * | | libgit2: provide init_count of the libraryEdward Thomson2020-12-094-0/+31
|/ / / | | | | | | | | | | | | | | | A function to provide the initialization count of the library; this is subject to race conditions but is useful for a naive determination as to whether the library has been initialized or not.
* | | Merge pull request #5720 from libgit2/ethomson/tlsdataEdward Thomson2020-12-0932-266/+454
|\ \ \ | | | | | | | | Thread-local storage: a generic internal library (with no allocations)
| * | | Replace global storage TLS with new interfaceethomson/tlsdataTyler Ang-Wanek2020-12-081-87/+15
| | | |
| * | | threads: git_tls_data to git_tlsdataEdward Thomson2020-12-083-168/+164
| | | | | | | | | | | | | | | | Use a no-allocation approach to the TLS data abstraction.