This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
System call comparison
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Mike Stump <mrs at apple dot com>, Nicola Pero <nicola at brainstorm dot co dot uk>,Geoffrey Keating <geoffk at apple dot com>, gcc at gcc dot gnu dot org,Stan Shebs <shebs at apple dot com>, Zack Weinberg <zack at codesourcery dot com>,David Ayers <d dot ayers at inode dot at>
- Date: Sun, 3 Aug 2003 22:25:22 +0100
- Subject: System call comparison
- References: <20030729222547.GF14334@daikokuya.co.uk>
Neil Booth wrote:-
> o Reduced system calls for the file system. I've not done and test and
> counted yet (I'll do that over the next week) but because of the design
> I would be very surprised if they are not down substantially (say 20-40%).
Here are the results for compiling current toplev.c:
Before After
fstat() 174 182
lstat() 7 0
pch stuff 1206 16
open() 1061 593
read() 174 182
Total ex PCH 1416 973 (-31%)
The dramatic pch drop is because of some of Geoff's recent changes.
[this is a count of the number of passes through open_file_pch() that
don't exit immediately.] The old method resulted in less fstats and
opens, presumably path simplification allowed CPP to recognise something
as redundant that it no longer can without path simplification.
However, they appear to have shown up as calls to lstat() instead, to
check the simplification was valid. The near-halving in open() calls
is due to the better caching / lookup algorithm that means we don't
traipse through all directories before getting a cache hit.
Here is the same test for i386.c:
Before After
fstat() 148 153
lstat() 7 0
pch stuff 1102 18
open() 1044 564
read() 148 153
Total ex PCH 1347 888 (-34%)
and others are similar.
Neil.