mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
fec12c95f1
Summary: Unfortunately, `BonsaiChangeset::get_changeset_id()` is a fairly expensive operation, since it'll clone, serialize, and hash the changeset. In hooks in particular, since we run this once per hook execution (and therefore once per file), that can be come a problem. Indeed, on a commit with 1K file changes, hooks run for ~30 seconds (P129058164). According to perf, the overwhelming majority of that time is spent in computing hashes of bonsai changesets. For a commit with 10K changes, it spends time there as well, it took 3.5 hours. This diff updates hooks to compute the changeset id just once, which brings our time down to O(N) (where N = file changes). Reviewed By: StanislavGlebik Differential Revision: D21039811 fbshipit-source-id: 73f9939ffc7d095e717bdb5efc46dbf4ad312c65 |
||
---|---|---|
.. | ||
content-stores/src | ||
hooks-tests/src | ||
src |