Gentoo Archives: gentoo-performance

From: Chris Davies <c.davies@×××××××.org>
To: gentoo-performance@g.o
Subject: Re: [gentoo-performance] Re: (forw) -fbranch-probabilities optimisation
Date: Sat, 17 May 2003 21:42:16
Message-Id: 20030517214358.GA5950@vaughan.foofalicious.com
In Reply to: [gentoo-performance] Re: (forw) -fbranch-probabilities optimisation by Jonathan Chocron
1 No, it shouldn't cause any instability.
2
3 It merely modifies what the compiler does anyway, which is to provide hints to the processor about which branch it should speculatively execute.
4
5 Thanks,
6 C.Davies
7
8 * Jonathan Chocron (chocronj_l@×××××.fr) wrote:
9 > Hi,
10 >
11 > I am afraid I am not skilled enough to answer our question. However, I
12 > am very interested in what you say. Do you know if this optimization might cause
13 > some instability in the system ?
14 >
15 > I must say, I hav subscribed to that list about one week ago, and your
16 > post is the first I have ever seen, so I would not worry about
17 > cross-posting.
18 >
19 > Jonathan
20 >
21 > On Sat, 17 May 2003, Chris Davies wrote:
22 >
23 > > Sorry about the cross post, I didn't realise this list existed.
24 > >
25 > > ----- Forwarded message from Chris Davies <c.davies@×××××××.org> -----
26 > >
27 > > Hi,
28 > >
29 > > I had the idea to build -fbranch-probabilities optimisation into portage. This is where a sample run of data is taken using the program compiled with -fprofile-arcs, and that data then used to reorganise the object code so conditional branches are layed out in a more efficient manner.
30 > >
31 > > To give an idea about how much time this optimisation actually saves, I ran a test with bladeenc (an MP3 encoder) encoding an entire album of wav files. The CFLAGS used only differed by a the -fbranch-probabilities, and the test was run 5 times to get an average. The result was that the version with no branch data took 8.35.106s on average to complete the encoding, whereas the the optimised version took only 8.11.502s. The branch data was 64KBs in total.
32 > >
33 > > Does this sound like something we could work into portage? I initially had the idea of building patches for every package likely to be improved by this optimisation (mainly CPU bound ones) and just applying them to the package before compilation. The user could then choose wether or not to actually use the data by including or excluding -fbranch-probabilities in make.conf.
34 > >
35 > > Obviously I'd have to work up some kind of test rig to automatically generate arc data for packages, but that shouldn't be too much of a problem as long as we keep the number of packages under control. The only problem I can see is that -fbranch-probabilities spits out ugly warnings if no arc data is present, although in this situation gcc defaults back to it's standard behaviour (I think).
36 > >
37 > > Thoughts? Opinions?
38 > > Thanks,
39 > > C.Davies
40 > >
41 > >
42 > > --
43 > > gentoo-dev@g.o mailing list
44 > >
45 > > ----- End forwarded message -----
46 > >
47 > > --
48 > > gentoo-performance@g.o mailing list
49 > >
50 > >
51 >
52 > --
53 > Précision importante : les services de mon ancien fournisseur
54 > d'adresse e-mail étant dernièrement décevant, je suis en train de
55 > changer d'adresse. Veuillez donc m'écrire à chocronj@×××××××.com (il
56 > suffit de répondre à ce mail).
57 >
58 > --
59 > gentoo-performance@g.o mailing list
60
61 --
62 gentoo-performance@g.o mailing list

Replies