Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Feb 2016 01:28:37 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-fs@FreeBSD.org
Subject:   [Bug 207022] stat() 4 to 16 times slower on FreeBSD/UFS than on Linux/Ext4
Message-ID:  <bug-207022-3630-h5Ly063xxB@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-207022-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-207022-3630@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207022

--- Comment #13 from Steven Hartland <smh@FreeBSD.org> ---
How much time is this really using when testing here with
== gen ==
perl -e 'for (1..4200) {my $file = "file$_";open(my $fh, ">", $file) or die
"cannot open > $file: $!";}'
/== gen ==

== bin ==
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <err.h>
#include <sysexits.h>

int main(int argc, char* argv[])
{
        struct stat buf;
        char name[1024];
        int i;

        for (i = 1; i <= 4200; i++) {
                sprintf(name, "file%d", i);
                if (stat(name, &buf) != 0) {
                        printf("Tested %d files\n", i - 1);
                        err(EX_OSERR, NULL);
                }
        }
        printf("Tested %d files\n", i - 1);
}
/== bin ==
I'm seeing:
/usr/bin/time ./test
Tested 4201 files
        0.00 real         0.00 user         0.00 sys

-- 
You are receiving this mail because:
You are the assignee for the bug.

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-207022-3630-h5Ly063xxB>