Skip to content

Read object hash and reference backend directly from configuration

Sami Hiltunen requested to merge smh-no-command-detect into master

Gitaly is currently using Git commands to determine the reference backend and object hash of the repository. This is incredibly inefficient for such simple operations. This MR reads the values directly from the repository's configuration file to optimize.

While we could, we don't fully parse the configuration file or validate its structure. Gitaly is responsible for writing the configuration files so we can ensure we write well formed configuration files.

The object hash and reference backend detection speeds up roughly by 41x and this leads roughly to a 20% improvement in transaction throughput.

Before, 39.75 tx/s, 20.825 ms/tx, 1.75ms ref backend detection Näyttökuva_2024-10-01_kello_15.44.05

Näyttökuva_2024-10-01_kello_15.44.32

After 47.62 tx/s, 16.02 ms/tx, 42.7μs ref backend detection

Näyttökuva_2024-10-01_kello_15.42.06

Näyttökuva_2024-10-01_kello_15.52.21

Closes #6318 (closed)

Edited by Sami Hiltunen

Merge request reports

Loading