HomeSoftware Heritage

in_memory: Fix quadratic run time in snapshot_get_branches.

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

in_memory: Fix quadratic run time in snapshot_get_branches.

snapshot.branches is now an ImmutableDict, which is backed by
a tuple of tuples; so random accesses now take a linear time
instead of a constant time.

This commit replaces random accesses with a single scan of all
the items, and does existence checks in a set instead.

Details

Provenance
vlorentzAuthored on Jul 9 2020, 5:58 PM
vlorentzPushed on Jul 9 2020, 6:19 PM
Differential Revision
D3484: in_memory: Fix quadratic run time in snapshot_get_branches.
Build Status
Buildable 13545
Build 20731: test-and-buildJenkins console · Jenkins

Commit No Longer Exists

This commit no longer exists in the repository.