• Show log

    Commit

  • Hash : e99e833f
    Author : lhchavez
    Date : 2020-12-12T16:51:15

    Make git__strntol64() ~70%* faster
    
    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
    ```