[#99426] [Ruby master Bug#17098] Float#negative? reports negative zero as not negative — chris@...

Issue #17098 has been reported by chrisseaton (Chris Seaton).

12 messages 2020/08/01

[#99449] [Ruby master Bug#17100] Ractor: a proposal for new concurrent abstraction without thread-safety issues — ko1@...

Issue #17100 has been reported by ko1 (Koichi Sasada).

41 messages 2020/08/03

[#99474] [Ruby master Feature#17103] Add a :since option to ObjectSpace.dump_all — jean.boussier@...

Issue #17103 has been reported by byroot (Jean Boussier).

9 messages 2020/08/04

[#99485] [Ruby master Misc#17104] Why are interpolated string literals frozen? — bughitgithub@...

Issue #17104 has been reported by bughit (bug hit).

23 messages 2020/08/05

[#99499] [Ruby master Bug#17105] A single `return` can return to two different places in a proc inside a lambda inside a method — eregontp@...

Issue #17105 has been reported by Eregon (Benoit Daloze).

10 messages 2020/08/06

[#99582] [Ruby master Feature#17122] Add category to Warning#warn — eileencodes@...

Issue #17122 has been reported by eileencodes (Eileen Uchitelle).

20 messages 2020/08/13

[#99700] [Ruby master Bug#17129] bundle install `eventmachine` and `sassc` fails since 914b2208ab3eddec478cdc3e079e6c30d0f0892c — yasuo.honda@...

SXNzdWUgIzE3MTI5IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHlhaG9uZGEgKFlhc3VvIEhvbmRhKS4N

9 messages 2020/08/26

[ruby-core:99540] [Ruby master Feature#17109] Eliminate the performance impact of operands' order in array's | and &

From: andrey.samsonov@...
Date: 2020-08-10 12:27:44 UTC
List: ruby-core #99540
Issue #17109 has been updated by [email protected] (Andrey Samsonov).


> > The order is preserved from the original array.

My bad, I missed the comment. In this case, I think the optimisation is not worth a change in the spec.

----------------------------------------
Feature #17109: Eliminate the performance impact of operands' order in array's | and &
https://bugs.ruby-lang.org/issues/17109#change-86999

* Author: [email protected] (Andrey Samsonov)
* Status: Open
* Priority: Normal
----------------------------------------
When I do intersection (`a & b`) or union (`a | b`), usually the array in one position is more likely longer than the one in the other position. I always try to remember in what order I should write `a` and` b` for the best performance. The right answers for current implementation are `longer & shorter` and` longer | shorter`.

[Here](https://github.com/kryzhovnik/ruby/commit/3b5923746792db5a73bc80a2cb9fe982d41a9fa3) I suggest to make it simpler and eliminate the difference.

Sorry I don't know C. Though I suppose my solution might be too blunt and verbose, I hope it demonstrates the idea.

    make benchmark ITEM=array_union COMPARE_RUBY=~/.rbenv/versions/2.8.0-dev/bin/ruby

    |                          |compare-ruby|built-ruby|
    |:-------------------------|-----------:|---------:|
    |small-&                   |      4.315M|    4.228M|
    |                          |       1.02x|         -|
    |small-intersection        |      4.157M|    4.106M|
    |                          |       1.01x|         -|
    |big-&                     |    107.258k|  132.051k|
    |                          |           -|     1.23x|
    |big-intersection          |    103.245k|  128.052k|
    |                          |           -|     1.24x|
    |big-reverse-intersection  |     96.544k|  159.201k|
    |                          |           -|     1.65x|

My own [test](https://gist.github.com/kryzhovnik/288953a5c89df10e2611668703a1511c) shows 20-30% perf improvement of Array#union.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread