mirror of
https://git.zx2c4.com/cgit
synced 2025-08-03 09:34:43 +02:00
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>
This commit is contained in:
parent
54272e6096
commit
8813170390
3 changed files with 14 additions and 4 deletions
1
cgit.h
1
cgit.h
|
@ -61,6 +61,7 @@ struct cgit_repo {
|
|||
int snapshots;
|
||||
int enable_log_filecount;
|
||||
int enable_log_linecount;
|
||||
time_t mtime;
|
||||
};
|
||||
|
||||
struct cgit_repolist {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue