>From 8f34e10691c91b20d71f128af1ee2f66b57e6183 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker
Date: Wed, 9 Apr 2014 14:14:08 +0200 Subject: [PATCH] fts: avoid unnecessary strlen calls * lib/fts.c (_D_EXACT_NAMLEN): Remove macro. (fts_build): Store the length of the dp->d_name entry in a local variable instead of calling strlen() several times via the above, removed macro. For 'rm -rf some-dir' with e.g. 1M directory entries, this speeds up the run by ~4%, yet this reduces the execution time by about a third if run via "ltrace -c rm -rf some-dir". --- ChangeLog | 10 ++++++++++ lib/fts.c | 14 ++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d0ac9e..0e9a383 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-03-26 Bernhard Voelker + + fts: avoid unnecessary strlen calls + * lib/fts.c (_D_EXACT_NAMLEN): Remove macro. + (fts_build): Store the length of the dp->d_name entry in a local variable + instead of calling strlen() several times via the above, removed macro. + For 'rm -rf some-dir' with e.g. 1M directory entries, this speeds up the + run by ~4%, yet this reduces the execution time by about a third if run + via "ltrace -c rm -rf some-dir". + 2014-03-27 Paul Eggert obstack: Remove ancient NeXTSTEP gcc support conditional diff --git a/lib/fts.c b/lib/fts.c index bc3c3c1..592fe58 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -79,9 +79,6 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #endif #include