Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Compiling Ruby w/ Profile Guided Optimization

Reply
Thread Tools

Compiling Ruby w/ Profile Guided Optimization

 
 
Greg Buchholz
Guest
Posts: n/a
 
      05-11-2006
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/de...lang=ruby&id=0

....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

 
Reply With Quote
 
 
 
 
Phil Tomson
Guest
Posts: n/a
 
      05-11-2006
In article <(E-Mail Removed) .com>,
Greg Buchholz <(E-Mail Removed)> 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/de...lang=ruby&id=0
>
>...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
 
Reply With Quote
 
 
 
 
Greg Buchholz
Guest
Posts: n/a
 
      05-11-2006

Phil Tomson wrote:
>
> Cool! What exactly is 'profile guided optimization'?
>


http://gcc.gnu.org/news/profiledriven.html

Greg Buchholz

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zero Optimization and Sign Optimization??? Ravikiran C Programming 22 11-24-2008 03:19 AM
C Compiler and "Profile Guided Optimizations" llothar C Programming 7 05-13-2007 02:14 PM
Want to profile monitor for Fuji Frontier ICC profile? Lynn Digital Photography 9 09-08-2005 12:17 PM
Java Web Start app icons keep going in user profile not All Users profile Brad Java 1 07-19-2005 02:10 AM
Compiling when libedit is in path Is there a trick to compiling Ruby when libedit must exist in the search path? Can you statically link to readline 5.0 in some manner? -- Lon Baker Lon Baker Ruby 1 03-21-2005 08:57 AM



Advertisments