<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/benchmark, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[Feature #18033] Make Time.new parse time strings</title>
<updated>2022-12-16T13:52:59+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-09-04T15:24:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8c272f44816f098c1e057c72a47451efc8cd1739'/>
<id>8c272f44816f098c1e057c72a47451efc8cd1739</id>
<content type='text'>
`Time.new` now parses strings such as the result of `Time#inspect`
and restricted ISO-8601 formats.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Time.new` now parses strings such as the result of `Time#inspect`
and restricted ISO-8601 formats.
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce BOP_CMP for optimized comparison</title>
<updated>2022-12-06T20:37:23+00:00</updated>
<author>
<name>Daniel Colson</name>
<email>danieljamescolson@gmail.com</email>
</author>
<published>2022-11-23T02:16:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e69b91fae4602b69c5ef45fcf82932adde8b31d8'/>
<id>e69b91fae4602b69c5ef45fcf82932adde8b31d8</id>
<content type='text'>
Prior to this commit the `OPTIMIZED_CMP` macro relied on a method lookup
to determine whether `&lt;=&gt;` was overridden. The result of the lookup was
cached, but only for the duration of the specific method that
initialized the cmp_opt_data cache structure.

With this method lookup, `[x,y].max` is slower than doing `x &gt; y ?
x : y` even though there's an optimized instruction for "new array max".
(John noticed somebody a proposed micro-optimization based on this fact
in https://github.com/mastodon/mastodon/pull/19903.)

```rb
a, b = 1, 2
Benchmark.ips do |bm|
  bm.report('conditional') { a &gt; b ? a : b }
  bm.report('method') { [a, b].max }
  bm.compare!
end
```

Before:

```
Comparison:
         conditional: 22603733.2 i/s
              method: 19820412.7 i/s - 1.14x  (± 0.00) slower
```

This commit replaces the method lookup with a new CMP basic op, which
gives the examples above equivalent performance.

After:

```
Comparison:
              method: 24022466.5 i/s
         conditional: 23851094.2 i/s - same-ish: difference falls within
error
```

Relevant benchmarks show an improvement to Array#max and Array#min when
not using the optimized newarray_max instruction as well. They are
noticeably faster for small arrays with the relevant types, and the same
or maybe a touch faster on larger arrays.

```
$ make benchmark COMPARE_RUBY=&lt;master@5958c305&gt; ITEM=array_min
$ make benchmark COMPARE_RUBY=&lt;master@5958c305&gt; ITEM=array_max
```

The benchmarks added in this commit also look generally improved.

Co-authored-by: John Hawthorn &lt;jhawthorn@github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prior to this commit the `OPTIMIZED_CMP` macro relied on a method lookup
to determine whether `&lt;=&gt;` was overridden. The result of the lookup was
cached, but only for the duration of the specific method that
initialized the cmp_opt_data cache structure.

With this method lookup, `[x,y].max` is slower than doing `x &gt; y ?
x : y` even though there's an optimized instruction for "new array max".
(John noticed somebody a proposed micro-optimization based on this fact
in https://github.com/mastodon/mastodon/pull/19903.)

```rb
a, b = 1, 2
Benchmark.ips do |bm|
  bm.report('conditional') { a &gt; b ? a : b }
  bm.report('method') { [a, b].max }
  bm.compare!
end
```

Before:

```
Comparison:
         conditional: 22603733.2 i/s
              method: 19820412.7 i/s - 1.14x  (± 0.00) slower
```

This commit replaces the method lookup with a new CMP basic op, which
gives the examples above equivalent performance.

After:

```
Comparison:
              method: 24022466.5 i/s
         conditional: 23851094.2 i/s - same-ish: difference falls within
error
```

Relevant benchmarks show an improvement to Array#max and Array#min when
not using the optimized newarray_max instruction as well. They are
noticeably faster for small arrays with the relevant types, and the same
or maybe a touch faster on larger arrays.

```
$ make benchmark COMPARE_RUBY=&lt;master@5958c305&gt; ITEM=array_min
$ make benchmark COMPARE_RUBY=&lt;master@5958c305&gt; ITEM=array_max
```

The benchmarks added in this commit also look generally improved.

Co-authored-by: John Hawthorn &lt;jhawthorn@github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename --mjit-min-calls to --mjit-call-threshold (#6731)</title>
<updated>2022-11-15T07:38:52+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-15T07:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d15d1c01c28f63888475f8016adbc8b4f982b573'/>
<id>d15d1c01c28f63888475f8016adbc8b4f982b573</id>
<content type='text'>
for consistency with YJIT</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
for consistency with YJIT</pre>
</div>
</content>
</entry>
<entry>
<title>Improve HTML escape benchmarks</title>
<updated>2022-11-05T06:54:25+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-05T06:24:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f276d5a7fe28ae4fd2934af4befd920bb78cfa9e'/>
<id>f276d5a7fe28ae4fd2934af4befd920bb78cfa9e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve performance some `Integer` and `Float` methods [Feature #19085] (#6638)</title>
<updated>2022-10-27T16:13:16+00:00</updated>
<author>
<name>S.H</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2022-10-27T16:13:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c6f439a6a8df582416e756d7511aa4d9c72071a9'/>
<id>c6f439a6a8df582416e756d7511aa4d9c72071a9</id>
<content type='text'>
* Improve some Integer and Float methods

* Using alias and Remove unnecessary code

* Remove commentout code</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Improve some Integer and Float methods

* Using alias and Remove unnecessary code

* Remove commentout code</pre>
</div>
</content>
</entry>
<entry>
<title>Add several new methods for getting and setting buffer contents. (#6434)</title>
<updated>2022-09-26T05:06:12+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-09-26T05:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=025b8701c09813c40339bd8fa1c75e0e5eaf7120'/>
<id>025b8701c09813c40339bd8fa1c75e0e5eaf7120</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Adds a benchmark to measure freezing objects</title>
<updated>2022-09-22T17:29:43+00:00</updated>
<author>
<name>Jemma Issroff</name>
<email>jemmaissroff@gmail.com</email>
</author>
<published>2022-09-22T16:20:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b5c459d57af182173ff888b362a38d721c780aa9'/>
<id>b5c459d57af182173ff888b362a38d721c780aa9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>avoid extra dup and pop in compile_op_asgn2</title>
<updated>2022-09-22T16:47:13+00:00</updated>
<author>
<name>HParker</name>
<email>HParker@github.com</email>
</author>
<published>2022-09-21T21:12:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fbaac837cfba23a9d34dc7ee144d7940248222a2'/>
<id>fbaac837cfba23a9d34dc7ee144d7940248222a2</id>
<content type='text'>
Co-authored-by: John Hawthorn &lt;jhawthorn@github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: John Hawthorn &lt;jhawthorn@github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix style on vm_ivar benchmarks (#6379)</title>
<updated>2022-09-15T00:39:39+00:00</updated>
<author>
<name>Jemma Issroff</name>
<email>jemmaissroff@gmail.com</email>
</author>
<published>2022-09-15T00:39:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=aecb57ceb0c690b05ad29a91c418e075342ea84a'/>
<id>aecb57ceb0c690b05ad29a91c418e075342ea84a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add vm_ivar get, get_unitialized, and lazy_set benchmarks</title>
<updated>2022-09-14T20:50:47+00:00</updated>
<author>
<name>Jemma Issroff</name>
<email>jemmaissroff@gmail.com</email>
</author>
<published>2022-09-14T20:48:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=513a11b477bb334413452b6004bc7d2d0a3eed4f'/>
<id>513a11b477bb334413452b6004bc7d2d0a3eed4f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
