Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Compiling Ruby w/ Profile Guided Optimization
Greg Buchholz
5/11/2006 9:13:00 PM
Since gcc-4.1 now has the option to perform profile guided
optimization, I thought I'd try compiling a version of Ruby with this
feature turned on. For the (somewhat contrived/synthetic) scenario
below, it looks like compiling with profile guided optimization turned
on, along with -O3, results in about a 9% speed increase vs. -O3 alone.
YMMV. I compiled a version of Ruby-1.8.4 using the following config
options...
configure CFLAGS="-O3 -fprofile-generate"
LDFLAGS=-fprofile-generate
....Then I ran the short version of the n-body program from the Great
Computer Language Shootout with n=1000...
http://shootout.alioth.debian.org/debian/benchmark.php?test=nbody&lang=rub...
....this generated the profile information needed for the next stage. I
then compiled a Ruby with...
configure CFLAGS="-O3 -fprofile-use"
....Running the resulting interpreter runs the exact same n-body program
about 8-10% faster than an compiling with just -O3.
FWIW,
Greg Buchholz
2 Answers
ptkwt
5/11/2006 10:38:00 PM
0
In article <1147381980.599350.283360@y43g2000cwc.googlegroups.com>,
Greg Buchholz <sleepingsquirrel@yahoo.com> wrote:
> Since gcc-4.1 now has the option to perform profile guided
>optimization, I thought I'd try compiling a version of Ruby with this
>feature turned on. For the (somewhat contrived/synthetic) scenario
>below, it looks like compiling with profile guided optimization turned
>on, along with -O3, results in about a 9% speed increase vs. -O3 alone.
> YMMV. I compiled a version of Ruby-1.8.4 using the following config
>options...
>
> configure CFLAGS="-O3 -fprofile-generate"
>LDFLAGS=-fprofile-generate
>
>...Then I ran the short version of the n-body program from the Great
>Computer Language Shootout with n=1000...
>
>
>
http://shootout.alioth.debian.org/debian/benchmark.php?test=nbody&lang=rub...
>
>...this generated the profile information needed for the next stage. I
>then compiled a Ruby with...
>
> configure CFLAGS="-O3 -fprofile-use"
>
>...Running the resulting interpreter runs the exact same n-body program
>about 8-10% faster than an compiling with just -O3.
>
Cool! What exactly is 'profile guided optimization'?
Phil
Greg Buchholz
5/11/2006 11:41:00 PM
0
Phil Tomson wrote:
>
> Cool! What exactly is 'profile guided optimization'?
>
http://gcc.gnu.org/news/profiled...
Greg Buchholz
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Compiling Ruby w/ Profile Guided Optimization
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password