我想知道如果我有这样的事情include?
方法多少可以影响性能:使用Ruby的性能'include?'方法
array = [<array_values>] # Read above for more information
(0..<n_iterations>).each { |value| # Read above for more information
array.include?(value)
}
的情况下<array_values>
是10,100和1.000以及<n_iterations>
是10,100,1000
您是否尝试在IRB/Rails控制台中运行代码? –
另外,你的问题对我来说有点不清楚。你能提供一个'array'的例子吗? –
@Andrew Grimm - 我如何尝试在IRB/Rails控制台中运行代码,并获取有关此事的性能时间或其他重要信息? – user502052