Skip to content

Reduce number of Git commands spawned during transaction processing

Sami Hiltunen requested to merge smh-tx-mgr-performance into master

TransactionManager is using localrepo.Repo to do various operations. In some of the cases, the Git wrappers end up spawning lots of redundant Git commands to check the repository's object hash and reference backend. While generally these only take 1.5ms, this is too long in the context of transaction processing, and the multiple instances add up.

The repeated syscall blocks below all related to object hash and reference backend detection, and they dominate the transaction processing times. Before the optimizations, the throughput was roughly 17 tx/s. Each transaction takes about 55ms to process.

Näyttökuva_2024-09-26_kello_15.42.35

This MR applies performance optimizations by ensuring we resolve the object hash and reference backends only once, and reuse the values at all other call sites during processing of a single transaction. After the optimizations, the trace below shows significantly less of those syscall blocks. The transaction throguhput has increased to roughly 34 tx/s, leading to a roughly 100% performance improvement. Each transaction takes about 25ms to process.

Näyttökuva_2024-09-26_kello_19.59.12

While there are lots of improvements that can be made, this is a good point to cut off the first batch of optimizations.

Merge request reports

Loading