HomeSoftware Heritage

from_disk: only build a model object once

Description

from_disk: only build a model object once

Before this change, a Directory object was built to compute the id of
we fed to the Directory object we built for to_model.

We tested this change on simple information of the Mercurial loader,
with a noop-loader stockage:

swh loader run mercurial https://foss.heptapod.net/mercurial/mercurial-devel directory=/data/repos/mercurial-devel

Median time of 3 run

before: 17 minutes 48 seconds
after: 12 minutes 59 seconds

On a profile of the same run, the to_model call of the from_disk's Directory class took the following percentage:
before: 43%
after: 24%

Details

Provenance
marmouteAuthored on Sep 20 2022, 2:26 PM
marmoutePushed on Sep 26 2022, 2:28 PM
Differential Revision
D8510: from_disk: only build a model object once
Parents
rDMOD9ce6feb9d607: Add support for old dicts in RawExtrinsicMetadata.from_dict
Branches
Unknown
Tags
Unknown
Build Status
Buildable 31738
Build 49661: test-and-buildJenkins console · Jenkins