]> git.ipfire.org Git - thirdparty/coreutils.git/commit
Rewrite using save-cwd.c and chdir to remove quadratic component of complexity.
authorJim Meyering <jim@meyering.net>
Sun, 15 Jun 1997 13:34:47 +0000 (13:34 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 15 Jun 1997 13:34:47 +0000 (13:34 +0000)
commitacdc74dbf5fb1b7b7d3a71d2f6ebce55b966078d
tree82d2c5050ab96e145cb005272976eb6587886331
parent1830d29be953ada28aba87962b941ee849f2224e
Rewrite using save-cwd.c and chdir to remove quadratic component of complexity.
Before, it processed O(n^2) directory name components via stat and mkdir.
Now it's O(n).  This makes mkdir -p a lot more efficient when creating
directories with very many components.  On a Linux 2.0.30 ext2fs filesystem
this command: mkdir -p `perl -e 'print "a/" x 500'`  now runs in 0.77 seconds
(user+sys).  Contrast that with the 9.5(!) seconds it took before.
lib/makepath.c