]> git.cameronkatri.com Git - cgit.git/commit
ui-repolist: implement lazy caching of repo->mtime
authorLars Hjemli <hjemli@gmail.com>
Sat, 29 Nov 2008 15:46:37 +0000 (16:46 +0100)
committerLars Hjemli <hjemli@gmail.com>
Sat, 29 Nov 2008 15:46:37 +0000 (16:46 +0100)
commit8813170390f3c3a0f4743afbc92ede42953fa3b0
tree39305350baee1eb564aae00294634bbe544983d3
parent54272e60965ec6a98b49cbf67d72a4b1f5adc55b
ui-repolist: implement lazy caching of repo->mtime

When sorting the list of repositories by their last modification time,
cgit would (in the worst case) invoke fstat(3) four times and open(3)
twice for each callback from qsort(3). This obviously scales very badly.

Now, the calculated modtime for each repo is saved in repo->mtime, thus
keeping the number of stat/open invocations identical for sorted and
unsorted repo-listings.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
cgit.h
shared.c
ui-repolist.c