coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "ls -l": Avoid unnecessary getxattr() overhead


From: Jérémy Compostella
Subject: Re: "ls -l": Avoid unnecessary getxattr() overhead
Date: Mon, 06 Feb 2012 16:09:26 +0100

Sven,

As I'm stuck home today (unusual snow at Bordeaux, France), I made some
tests:

1. time ls -l > /dev/null > /dev/null (with a 10 thousands files in
   current directory over NFS)

  a) With coreutils 8.5-1

real    0m4.242s
user    0m0.132s
sys     0m0.504s

  b) With coreutils devel 8.15

real    0m4.162s
user    0m0.116s
sys     0m0.392s

2. strace -c ls -l > /dev/null (on the same directory)

  a) With coreutils 8.5-1

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 60.27    0.044688           4     10000           lstat
 37.77    0.028002        2546        11           getdents
  1.18    0.000876           0     20000     20000 getxattr
  0.65    0.000480           0     10000     10000 lgetxattr
  0.13    0.000095           0      9999           stat
  0.00    0.000000           0        19           read
  0.00    0.000000           0       122           write
[...]

  b) With coreutils devel 8.15

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 65.22    0.037658           4     10000           lstat
 34.64    0.020002        1818        11           getdents
  0.13    0.000076           0      9999           stat
  0.00    0.000000           0        13           read
  0.00    0.000000           0       122           write
[...)

=> First, it looks like that the devel version does not call getxattr()
and lgetxattr() when unneeded. Second, the getxattr and lgetxattr
syscall are not the cause of the speed problem you talk about.

Cheers,

Jérémy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]