1
2
3
4
5
6
7
8
require 'fruity'

array = (1..10).to_a
set = array.to_set

compare array: ->{array.include?(42)},
        set:   ->{set.include?(42)}
# => set is faster than array by 3.4x ± 0.1