summaryrefslogtreecommitdiff
path: root/bundle.c
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2012-02-23 15:54:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-23 20:53:03 (GMT)
commit07b257f94035133376538c54620b43a14e28dcd3 (patch)
treec9a6032c32c62f0e38e830088869d13ed3d4c995 /bundle.c
parent2e3291ae1dc7790aa08c1eeb476fbf1c6d3a1ed9 (diff)
downloadgit-07b257f94035133376538c54620b43a14e28dcd3.zip
git-07b257f94035133376538c54620b43a14e28dcd3.tar.gz
git-07b257f94035133376538c54620b43a14e28dcd3.tar.bz2
gitweb: Faster project search
Before searching by some field the information we search for must be filled in, but we do not have to fill other fields that are not involved in the search. To be able to request filling only specified fields, fill_project_list_info() was enhanced in previous commit to take additional parameters which specify part of projects info to fill. This way we can limit doing expensive calculations (like running git-for-each-ref to get 'age' / "Last changed" info) to doing those only for projects which we will show as search results. This commit actually uses this interface, changing gitweb code from the following behavior fill all project info on all projects search projects to behaving like this pseudocode fill search fields on all projects search projects fill all project info on search results With this commit the number of git commands used to generate search results is 2*<matched projects> + 1, and depends on number of matched projects rather than number of all projects (all repositories). Note: this is 'git for-each-ref' to find last activity, and 'git config' for each project, and 'git --version' once. Example performance improvements, for search that selects 2 repositories out of 12 in total: * Before (warm cache): "This page took 0.867151 seconds and 27 git commands to generate." * After (warm cache): "This page took 0.673643 seconds and 5 git commands to generate." Now imagine that they are 5 repositories out of 5000, and cold or trashed cache case. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle.c')
0 files changed, 0 insertions, 0 deletions