Message from discussion
optimized builds possible/good?
Received: by 10.68.47.225 with SMTP id g1mr122465pbn.17.1302814232897;
Thu, 14 Apr 2011 13:50:32 -0700 (PDT)
X-BeenThere: emm-ruby@googlegroups.com
Received: by 10.68.36.67 with SMTP id o3ls437366pbj.0.p; Thu, 14 Apr 2011
13:50:32 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.68.5.35 with SMTP id p3mr53316pbp.59.1302814232219; Thu, 14
Apr 2011 13:50:32 -0700 (PDT)
Received: by o21g2000prh.googlegroups.com with HTTP; Thu, 14 Apr 2011 13:50:32
-0700 (PDT)
Date: Thu, 14 Apr 2011 13:50:32 -0700 (PDT)
In-Reply-To: <BANLkTi=e5JOTp4CEhxryP-xYcXc9+oU-6A@mail.gmail.com>
X-IP: 216.49.181.128
References: <09349afe-28a4-4316-969e-8905e6a6b398@b13g2000prf.googlegroups.com>
<BANLkTi=e5JOTp4CEhxryP-xYcXc9+oU-6A@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-Via: 1.1 CHQPVUA3455 (NetCache NetApp/6.0.1P3D3), 1.1 CHQPVUA3455
(NetCache NetApp/6.0.1P3D3)
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0,gzip(gfe)
Message-ID: <b12c6088-678e-4078-afb3-0bb018ea9563@o21g2000prh.googlegroups.com>
Subject: Re: optimized builds possible/good?
From: rogerdpack <rogerdp...@gmail.com>
To: Ruby Enterprise Edition <emm-ruby@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
> Has anyone confirmed that things like that actually result in
> noticeable speedups?
> Has anyone confirmed that things like that actually result in
> noticeable speedups?
The only real thing I remember was this:
http://replay.waybackmachine.org/20081120211035/http://www.jhaampe.org/articles/ruby/gcc
However some superficial benchmarking using optflags="-march=native -
O3" seemed to reveal speedups of about 10% for
Benchmark.measure { 10000000.times {} }
and also about 10% speedup for this:
def go; 3; end
Benchmark.measure { 10000000.times {go} }
Doing some rails benchmarks from the RBS [1] seemed to show speedup as
well (from 2% to 10% or so)
unoptimized: https://gist.github.com/920431
optimized: https://gist.github.com/920429
(no segfaults, though this was with GCC 4.4.5).
Unfortunately this was doing it in a VM so doesn't really count, but
it seems hopeful. I also haven't tried it on REE itself but assume it
will respond similarly. I'm also not sure if -O3 helps or hurts it,
but it didn't seem to segfault at all. I suppose profile guided
optimizations might help, too, but haven't tried them much. I'm sure
they wouldn't hurt.
Best wishes.
-r
[1] https://github.com/acangiano/ruby-benchmark-suite