Closed alchimere closed 4 years ago
According to a conference I just watched the Set class is very slow compared to simple Hash because of optimizations in the MRI for Hash accesses.
Set
So here is a PR that replaces Set with Hash. It results with a speed increase (can be up to 30%)
Here is the code of the benchmark and it's results before/after the patch: https://gist.github.com/alchimere/323a4803981e48fed2ce86ac5027693a
That looks promising – what do you think @dawidof?
According to a conference I just watched the
Set
class is very slow compared to simple Hash because of optimizations in the MRI for Hash accesses.So here is a PR that replaces Set with Hash. It results with a speed increase (can be up to 30%)
Here is the code of the benchmark and it's results before/after the patch: https://gist.github.com/alchimere/323a4803981e48fed2ce86ac5027693a