Skip to content
Snippets Groups Projects
Commit 9c543839 authored by Georges Racinet's avatar Georges Racinet
Browse files

Gitaly Comparison blob/tree: performance mitigation

The chunking logic of Gitaly is based on the message size in bytes
rather than on the number of returned items. Therefore, we can force
it to send two chunks with less files with longer file names.

hg-git being probably the bottleneck, making the file content smaller
also has a minor impact.

Overall, on the development setup I am currently using, the test setup
goes down from 3 minutes to 30 seconds. Still painful, but more
bearable.
parent 40ba766d
No related branches found
No related tags found
2 merge requests!98Merged stable branch into default,!95CommitService.GetTreeEntries: fixing pagination cursor
......@@ -212,9 +212,10 @@
sub.mkdir()
rel_paths = []
# Chunk size with Gitaly is big
for x in range(10000):
path = sub / ('bar%d' % x)
path.write_text('bar%d content' % x)
for x in range(2900):
# max file name length is 255 on most filesystems
path = sub / ('very-' * 46 + '-long-filename-bar%04d' % x)
path.write_text(str(x))
rel_paths.append(path)
# TODO OS indep for paths (actually TODO make wrapper.commit easier to
# use, e.g., check how to make it accept patterns)
......@@ -227,6 +228,8 @@
assert len(distinct_amounts) == 1
return next(iter(distinct_amounts))
# asking more than the expected Gitaly first chunk size (2888 entries)
# but still less than the total
git_resps, hg_resps = [
list(fixture.get_tree_entries_raw(vcs, b'sub',
recursive=True,
......@@ -230,7 +233,7 @@
git_resps, hg_resps = [
list(fixture.get_tree_entries_raw(vcs, b'sub',
recursive=True,
limit=9000))
limit=2890))
for vcs in ('git', 'hg')
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment