https://github.com/SoftwareHeritage/swh-model
Revision 2d65a24a5f413f3c647688e5d2ad7aa3268c1919 authored by Pierre-Yves David on 22 September 2022, 12:55:26 UTC, committed by Pierre-Yves David on 23 September 2022, 17:48:58 UTC
This reduce the number of function call and should be faster.

The mashup of blind optimisation in the previous changeset yield some
interesting results in total.

It would be insightful to measure them individually, but that would
take more time than we currently have.

When testing all the validator changes on our previous "benchmark" we
see quite interesting improvement.

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

= Median time of 3 run =
base:   17 minutes 48 seconds
before: 11 minutes 50 seconds
after:  11 minutes 11 seconds

On a profile of the same run, the `to_model` call of the from_disk's `Directory` class took the following percentage:
base:   43%
before: 15%
after:  11%
1 parent 3608271
History
Tip revision: 2d65a24a5f413f3c647688e5d2ad7aa3268c1919 authored by Pierre-Yves David on 22 September 2022, 12:55:26 UTC
model: inline the call to `_check_swhid`
Tip revision: 2d65a24
File Mode Size
bin
docs
swh
.git-blame-ignore-revs -rw-r--r-- 140 bytes
.gitignore -rw-r--r-- 137 bytes
.pre-commit-config.yaml -rw-r--r-- 847 bytes
AUTHORS -rw-r--r-- 112 bytes
CODE_OF_CONDUCT.md -rw-r--r-- 3.3 KB
CONTRIBUTORS -rw-r--r-- 63 bytes
LICENSE -rw-r--r-- 34.3 KB
MANIFEST.in -rw-r--r-- 157 bytes
Makefile -rw-r--r-- 163 bytes
Makefile.local -rw-r--r-- 24 bytes
README.md -rw-r--r-- 620 bytes
mypy.ini -rw-r--r-- 522 bytes
pyproject.toml -rw-r--r-- 237 bytes
pytest.ini -rw-r--r-- 276 bytes
requirements-cli.txt -rw-r--r-- 30 bytes
requirements-test.txt -rw-r--r-- 51 bytes
requirements.txt -rw-r--r-- 380 bytes
setup.cfg -rw-r--r-- 342 bytes
setup.py -rwxr-xr-x 2.4 KB
tox.ini -rw-r--r-- 1.7 KB

README.md

back to top