Deprecate passing string to define callback. - #22598
Conversation
|
r? @pixeltrix (@rails-bot has picked a reviewer for you, use r? to override) |
|
ref #22460 |
|
👍 @yui-knk 😄 As part of this commit, I think you should also remove this documentation. |
There was a problem hiding this comment.
Maybe we should create a Set so the performance of include? is better?
There was a problem hiding this comment.
Hm, looks like creating Sets is too slow. Here's a benchmark. With an Array of 10 elements, creating a Set and then calling #include? is 5x slower than creating an Array and calling #include?
There was a problem hiding this comment.
Yes, creating sets is slow but we are creating only once and we are calling include on every request so it may be worth using Set here.
There was a problem hiding this comment.
Per the size of the Array it will not matter.
There was a problem hiding this comment.
@nateberkopec Thanks for your help
$ ruby creating_set.rb
Calculating -------------------------------------
set include 45.093k i/100ms
array include 15.519k i/100ms
-------------------------------------------------
set include 713.458k (± 5.0%) i/s - 3.562M
array include 182.015k (± 4.3%) i/s - 915.621k
Comparison:
set include: 713457.8 i/s
array include: 182014.8 i/s - 3.92x slower
1547683 to
21f4017
Compare
|
@rafaelfranca I updatd 😍 |
Deprecate passing string to define callback.
No description provided.