summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorTian Yuchen <a3205153416@gmail.com>2026-01-31 01:01:23 +0800
committerJunio C Hamano <gitster@pobox.com>2026-01-30 09:13:47 -0800
commit8466efa4bd92b970f7a37159404aef33296d9d46 (patch)
tree7ec79bcd9e3157cd1136b455963a59ec53a10c2a /contrib/persistent-https
parentea717645d199f6f1b66058886475db3e8c9330e9 (diff)
downloadgit-8466efa4bd92b970f7a37159404aef33296d9d46.tar.gz
git-8466efa4bd92b970f7a37159404aef33296d9d46.zip
t/perf/p3400: speed up setup using fast-import
The setup phase in 't/perf/p3400-rebase.sh' generates 100 commits to simulate a noisy history. It currently uses a shell loop that invokes 'git add', 'git commit', 'test_seq', and 'sort' in each iteration. This incurs significant overhead due to repeated process spawning. Optimize the setup by using 'git fast-import' to generate the commit history. Additionally, pre-compute the forward and reversed file contents to avoid repetitive execution of 'seq' and 'sort'. To ensure the test measures rebase performance against a consistent object layout (rather than the suboptimal pack/loose objects created by the raw import), perform a full repack (`git repack -a -d`) at the end of the setup. This reduces the setup time significantly while maintaining the validity of the subsequent performance tests. Performance enhancement (Average value of 5 tests): Real Rebase Before: 29.045s 13.34s After: 21.989s 12.84s Measured on Lenovo Yoga 2020, Ubuntu 24.04. Signed-off-by: Tian Yuchen <a3205153416@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions