Re: [PATCH 20/25] list-files: preload index
On Mon, Apr 6, 2015 at 9:52 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> Try to reduce refresh time. Note that we still need another
> read_cache() at top top, before parse_pathspec() because this
> *_SLASH_CHEAP needs the index loaded.
>
> One day read_index() should be improved to notice that the on-disk
> version is the same as the one in memory and skip I/O entirely..
Show 19 quoted lines
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> builtin/list-files.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/builtin/list-files.c b/builtin/list-files.c
> index 31c2336..948b8e6 100644
> --- a/builtin/list-files.c
> +++ b/builtin/list-files.c
> @@ -529,6 +529,7 @@ int cmd_list_files(int argc, const char **argv, const char *cmd_prefix)
> recursive_pathspec.max_depth = -1;
> finalize_colopts(&colopts, -1);
>
> + read_cache_preload(&recursive_pathspec);
> refresh_index(&the_index, REFRESH_QUIET | REFRESH_UNMERGED,
> &recursive_pathspec, NULL, NULL);
>
> --
> 2.3.0.rc1.137.g477eb31