https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2013-04-03T18:07:36Z
Ruby Issue Tracking System
Ruby master - Bug #8211: Performance regression of method calls
https://bugs.ruby-lang.org/issues/8211?journal_id=38163
2013-04-03T18:07:36Z
dunric (David Unric)
dunric29a@gmail.com
<ul></ul><p>I had to add the testing platform is Linux x86_64 and interpreters were built with GCC 4.7.2 .</p>
Ruby master - Bug #8211: Performance regression of method calls
https://bugs.ruby-lang.org/issues/8211?journal_id=38189
2013-04-04T06:14:00Z
drbrain (Eric Hodel)
drbrain@segment7.net
<ul><li><strong>Priority</strong> changed from <i>5</i> to <i>Normal</i></li></ul><p>=begin<br>
I can't reproduce with clang on OS X:</p>
<p>ruby 2.1.0dev (2013-04-04 trunk 40091) [x86_64-darwin12.3.0]</p>
<p>lambda: 7.310000 0.000000 7.310000 ( 7.303881)<br>
instance method: 4.310000 0.000000 4.310000 ( 4.310044)<br>
class method: 4.320000 0.000000 4.320000 ( 4.317902)</p>
<p>ruby 2.0.0p57 (2013-03-12 revision 39728) [x86_64-darwin12.2.1]</p>
<p>lambda: 7.290000 0.000000 7.290000 ( 7.290216)<br>
instance method: 4.330000 0.000000 4.330000 ( 4.332266)<br>
class method: 4.410000 0.000000 4.410000 ( 4.410439)</p>
<p>ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.1]</p>
<p>lambda: 8.010000 0.000000 8.010000 ( 8.014676)<br>
instance method: 4.580000 0.000000 4.580000 ( 4.573837)<br>
class method: 4.480000 0.000000 4.480000 ( 4.485607)</p>
<p>=end</p>
Ruby master - Bug #8211: Performance regression of method calls
https://bugs.ruby-lang.org/issues/8211?journal_id=38191
2013-04-04T07:33:13Z
jonforums (Jon Forums)
<ul></ul><p>=begin<br>
I can't replicate the 1.9.3 vs. 2.0.0 results on my old Win7 32-bit box. 1.9.3 was built with mingw 4.6.2, and 2.0.0 was built with mingw-w64 4.7.2</p>
<p>==== ruby 1.9.3p408 (2013-04-02 revision 40056) [i386-mingw32]</p>
<p>lambda: 11.576000 0.000000 11.576000 ( 11.580016)<br>
instance method: 7.456000 0.000000 7.456000 ( 7.460011)<br>
class method: 7.676000 0.000000 7.676000 ( 7.670011)</p>
<p>==== ruby 2.0.0p102 (2013-04-03 revision 40075) [i386-mingw32]</p>
<p>lambda: 11.669000 0.000000 11.669000 ( 11.710016)<br>
instance method: 7.051000 0.000000 7.051000 ( 7.050010)<br>
class method: 6.864000 0.000000 6.864000 ( 6.880010)<br>
=end</p>
Ruby master - Bug #8211: Performance regression of method calls
https://bugs.ruby-lang.org/issues/8211?journal_id=38202
2013-04-04T14:08:42Z
bitsweat (Jeremy Daer)
jeremydaer@gmail.com
<ul></ul><p>David, this looks a lot like the CFLAGS issues folks were hitting with rvm. Essentially, getting unoptimized Ruby builds.</p>
<p>Take a close look at the differences in RbConfig::CONFIG between your Ruby builds.</p>
<p>ruby -e 'puts RUBY_DESCRIPTION, RbConfig::CONFIG["cflags"], RbConfig::CONFIG["CFLAGS"]'</p>
<p>How did you build Ruby?</p>
Ruby master - Bug #8211: Performance regression of method calls
https://bugs.ruby-lang.org/issues/8211?journal_id=38210
2013-04-04T16:53:26Z
funny_falcon (Yura Sokolov)
funny.falcon@gmail.com
<ul></ul><p>Is your platform 32bit? Than it is cause of -fPIE</p>
<p>2013/4/4 bitsweat (Jeremy Kemper) <a href="mailto:jeremy@bitsweat.net" class="email">jeremy@bitsweat.net</a></p>
<blockquote>
<p>Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Performance regression of method calls (Closed)" href="https://bugs.ruby-lang.org/issues/8211">#8211</a> has been updated by bitsweat (Jeremy Kemper).</p>
<p>David, this looks a lot like the CFLAGS issues folks were hitting with<br>
rvm. Essentially, getting unoptimized Ruby builds.</p>
<p>Take a close look at the differences in RbConfig::CONFIG between your Ruby<br>
builds.</p>
<p>ruby -e 'puts RUBY_DESCRIPTION, RbConfig::CONFIG["cflags"],<br>
RbConfig::CONFIG["CFLAGS"]'</p>
<a name="How-did-you-build-Ruby"></a>
<h2 >How did you build Ruby?<a href="#How-did-you-build-Ruby" class="wiki-anchor">¶</a></h2>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Performance regression of method calls (Closed)" href="https://bugs.ruby-lang.org/issues/8211">#8211</a>: Performance regression of method calls<br>
<a href="https://bugs.ruby-lang.org/issues/8211#change-38202" class="external">https://bugs.ruby-lang.org/issues/8211#change-38202</a></p>
<p>Author: dunric (David Unric)<br>
Status: Open<br>
Priority: Normal<br>
Assignee:<br>
Category: core<br>
Target version:<br>
ruby -v: 2.0.0p0</p>
<p>There are significant performance regressions in the newer Ruby versions.<br>
When compared to the last 1.9 patch build, method & lambda calls are about<br>
3 times slower !</p>
<p>Benchmarking results:</p>
<hr>
<p>Ruby 1.9.3p392<br>
user system total real<br>
lambda: 8.310000 0.000000 8.310000 ( 8.315247)<br>
instance method: 5.210000 0.000000 5.210000 ( 5.219299)<br>
class method: 5.040000 0.000000 5.040000 ( 5.037483)</p>
<p>Ruby 2.0.0-p0<br>
user system total real<br>
lambda: 25.310000 0.010000 25.320000 ( 25.339897)<br>
instance method: 17.870000 0.000000 17.870000 ( 17.882656)<br>
class method: 17.630000 0.010000 17.640000 ( 17.650515)</p>
<p>Ruby 2.1.0-dev<br>
user system total real<br>
lambda: 19.210000 0.000000 19.210000 ( 19.227314)<br>
instance method: 13.930000 0.000000 13.930000 ( 13.936974)<br>
class method: 14.000000 0.000000 14.000000 ( 14.001582)</p>
<hr>
<p>The code:</p>
<hr>
<p>require 'benchmark'</p>
<p>do_custom_stuff = lambda { 1 + 1 + 1 }</p>
<p>class CustomStuff<br>
def self.do<br>
1 + 1 + 1<br>
end</p>
<p>def do<br>
1 + 1 + 1<br>
end<br>
end</p>
<p>custom_stuff = CustomStuff.new</p>
<p>Benchmark.bm { |b|<br>
MANY = 50_000_000<br>
b.report("lambda:") { MANY.times { do_custom_stuff.call }}<br>
b.report("instance method:") { MANY.times { custom_stuff.do }}<br>
b.report("class method:") { MANY.times { CustomStuff.do }}<br>
}</p>
<hr>
<p>--<br>
<a href="http://bugs.ruby-lang.org/" class="external">http://bugs.ruby-lang.org/</a></p>
</blockquote>
Ruby master - Bug #8211: Performance regression of method calls
https://bugs.ruby-lang.org/issues/8211?journal_id=38231
2013-04-05T00:22:49Z
dunric (David Unric)
dunric29a@gmail.com
<ul></ul><p>bitsweat (Jeremy Kemper) wrote:</p>
<blockquote>
<p>David, this looks a lot like the CFLAGS issues folks were hitting with rvm. Essentially, getting unoptimized Ruby builds.</p>
<p>Take a close look at the differences in RbConfig::CONFIG between your Ruby builds.</p>
<p>ruby -e 'puts RUBY_DESCRIPTION, RbConfig::CONFIG["cflags"], RbConfig::CONFIG["CFLAGS"]'</p>
<p>How did you build Ruby?</p>
</blockquote>
<p>ruby -e 'puts RUBY_DESCRIPTION, RbConfig::CONFIG["cflags"], RbConfig::CONFIG["CFLAGS"]'</p>
<p>ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]<br>
-O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration</p>
Ruby master - Bug #8211: Performance regression of method calls
https://bugs.ruby-lang.org/issues/8211?journal_id=38232
2013-04-05T00:39:51Z
dunric (David Unric)
dunric29a@gmail.com
<ul></ul><p>Asking to close this issue (reason: suboptimal compiler flags).</p>
<p>I've rebuilt Ruby with the following options and now get the expected performance:</p>
<p>ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]<br>
-O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration<br>
-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC</p>
<pre><code> user system total real
</code></pre>
<p>lambda: 7.650000 0.000000 7.650000 ( 7.651665)<br>
instance method: 4.350000 0.000000 4.350000 ( 4.352077)<br>
class method: 4.290000 0.000000 4.290000 ( 4.296082)</p>
Ruby master - Bug #8211: Performance regression of method calls
https://bugs.ruby-lang.org/issues/8211?journal_id=38236
2013-04-05T04:53:43Z
marcandre (Marc-Andre Lafortune)
marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul>