Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 7 Nov 2011 06:13:02 +0400
From: Solar Designer <solar@...nwall.com>
To: owl-dev@...ts.openwall.com
Subject: Re: %optflags for new gcc

On Wed, Oct 26, 2011 at 11:17:35AM +0400, Solar Designer wrote:
> Maybe we need to run more benchmarks ourselves.

I did some of that, using john-1.7.8-jumbo-7's 158 individual benchmark
results (per invocation):

http://www.openwall.com/lists/john-users/2011/11/07/1

Summary: overall, -Os produced code that is 8.5% slower than -O2's, even
though some individual benchmarks were faster with -Os.  This is for
x86_64 code running on Core 2.  I might repeat this test for i686.

Now, testing -fstack-protector, I get no overall slowdown at all - in
fact, I get a 0.1% to 0.3% speedup. %-)

$ ./relbench.pl asis ssp
Geometric mean of 158:  1.003108 real, 1.003675 virtual
Standard deviation:     0.168961 real, 0.172088 virtual
$ ./relbench.pl asis ssp-2
Geometric mean of 158:  1.003138 real, 1.003266 virtual
Standard deviation:     0.215210 real, 0.222805 virtual
$ ./relbench.pl asis-2 ssp
Geometric mean of 158:  1.002541 real, 1.001533 virtual
Standard deviation:     0.137535 real, 0.133446 virtual
$ ./relbench.pl asis-2 ssp-2
Geometric mean of 158:  1.002570 real, 1.001125 virtual
Standard deviation:     0.177295 real, 0.185849 virtual

That's with the default ssp-buffer-size, though (at 8).  I should repeat
that test with a lower ssp-buffer-size.

However, going to -fstack-protector-all results in a 1.5% slowdown:

$ ./relbench.pl asis sspa
Geometric mean of 158:  0.987096 real, 0.987655 virtual
Standard deviation:     0.221125 real, 0.221289 virtual
$ ./relbench.pl asis sspa-2
Geometric mean of 158:  0.984913 real, 0.985332 virtual
Standard deviation:     0.246147 real, 0.246518 virtual
$ ./relbench.pl asis-2 sspa
Geometric mean of 158:  0.986537 real, 0.985547 virtual
Standard deviation:     0.203971 real, 0.206537 virtual
$ ./relbench.pl asis-2 sspa-2
Geometric mean of 158:  0.984356 real, 0.983230 virtual
Standard deviation:     0.231049 real, 0.228961 virtual

If anyone wants to play with this, the Perl script is available in the
john-users posting referenced above.

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.