Project

General

Profile

Actions

Feature #12810

closed

Improve `Set#find_index` performance

Added by Asche (Thomas Charbonnel) over 7 years ago. Updated over 7 years ago.

Status:
Rejected
Target version:
-
[ruby-core:77490]

Description

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0