]> git.ipfire.org Git - thirdparty/ccache.git/commit
process_preprocessed_file: Move gnu_getcwd() out of tight loop
authorMike Gulick <mgulick@mathworks.com>
Tue, 24 Jul 2018 19:23:03 +0000 (15:23 -0400)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 18 Aug 2018 20:31:01 +0000 (22:31 +0200)
commitdde3543c6a556909c8c2092e6fbfcc14d9f5f5ac
treeef17307f269a923eff1209a6b6b461e590c62342
parentebea06d8c4c5f157a10d60f8be459722c1a1d265
process_preprocessed_file: Move gnu_getcwd() out of tight loop

Change process_preprocessed_file from calling getcwd() once per line
in the preprocessed source file to once at the start of the function.
The performance of getcwd() on Mac seems to be terrible compared to
Linux.  On a macOS 10.13 build machine, this change improves
process_preprocessed_file runtime on a 10MB preprocessed file from 75
seconds to .75 seconds.
src/ccache.c