PERF: start caching indexOf if array grows beyond a point