From: knu@... Date: 2016-11-05T02:27:44+00:00 Subject: [ruby-core:77945] [Ruby trunk Feature#12810][Rejected] Improve `Set#find_index` performance Issue #12810 has been updated by Akinori MUSHA. Status changed from Assigned to Rejected As commented by Herwin W and replied to the submitter in a personal mail, Set has no sense of index where elements are theoretically unordered. It's just that a Set happens to respond to `find_index` via the Enumerable module and have an order due to its implementation. If you need `find_index` then Set is not likely the solution for your problem. You should use Hash directly. Thanks for the feedback anyway! ---------------------------------------- Feature #12810: Improve `Set#find_index` performance https://bugs.ruby-lang.org/issues/12810#change-61267 * Author: Thomas Charbonnel * Status: Rejected * Priority: Normal * Assignee: Akinori MUSHA ---------------------------------------- Hello everyone! I've toyed a bit with the `Set` class lately and have found some performance issues with method `find_index`. Github gist here: https://gist.github.com/thomascharbonnel/f023ca137f2b2b7021cbe2d580485cd4 I'm thinking it would be possible to add an index as default value for each new item of `Set` (instead of a boolean like now), `find_index` would then be executed in O(1). I can attach a patch in a few days if everybody is cool with the idea. Thanks! Thomas. -- https://bugs.ruby-lang.org/ Unsubscribe: