On 12/20/09 7:02 PM, James Westby wrote:
From: Tomas Carnecky<t...@dbservice.com>
Use stat(2) instead.
Signed-off-by: Tomas Carnecky<t...@dbservice.com>
Signed-off-by: James Westby<jw+deb...@jameswestby.net>
The original patch duplicated asprintf and stat calls, rearraging
the code means we don't need to.
I have a concern about the duplicated stats in is_maildir, but they
are not so easy to save. I ran a quick timing test (3931 files), dropping
caches before each set:
This shoes there is little impact of the code, but given that it is
around one percent we may want to make it conditional on platform
and save the extra stat calls.
If performance regression is an issue, something like this could be used
to keep the current code paths in linux and stat() on other platforms:
is_dir(const char *path, struct dirent *dirent)
... sprintf, stat etc
return dirent->d_type == DT_DIR;
notmuch mailing list