Use a binary search to find child nodes by position in large lists
In a benchmark with 200,000 methods in a type, ChildThatContainsPosition was the clear bottleneck. For such cases, the syntax list is represented using a special type called WithLotsOfChildren (both VB and C# have this optimization) that has a constant-time implementation of GetSlotOffset. Given that, we can find the correct slot via binary search instead of a linear search. With this change, the benchmark compilation went from 45 seconds to 25 seconds. (changeset 1412034)
Showing
想要评论请 注册 或 登录