[Performance] Take advantage of new array range check elimination in other collections #20702
Labels
area-System.Collections
enhancement
Product code improvement that does NOT require public API changes/additions
help wanted
[up-for-grabs] Good issue for external contributors
tenet-performance
Performance related issue
Milestone
See dotnet/coreclr#9539 (comment); doing
if ((uint)index >= (uint)array.Length) { throw something; }
will now elide the range check forarray[index]
afterwards. Probably won't yield a huge benefit in most placecs, but the perf gains would be essentially free. We should probably do this in collections that are backed by arrays, e.g. here is one place where the new JIT behavior could be put to use.The text was updated successfully, but these errors were encountered: