Project

General

Profile

Actions

Misc #10754

closed

Tiny optimisation of Set#include?

Added by ismael (Ismael Abreu) almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Assignee:
-
[ruby-core:67664]

Description

Hi!

I'm not sure if this a relevant optimisation but here it goes. A simple way to improve Set#include?
I don't think there should be any side effects with this change.

Here are some dummy benchmarks https://gist.github.com/ismaelga/68bb3ea51b4742f65699
They are not consistent, but that should be because of garbage collection or something. Right?

I've also sent a Pull Request: https://github.com/ruby/ruby/pull/810


Files

patch.diff (544 Bytes) patch.diff ismael (Ismael Abreu), 01/18/2015 01:18 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0