When I debug step by step, I see that the Comparison assignment to CompareIDs method is made on every binary search call, again and again!? I assumed if I move it before the actual call of BinarySearch method, it will assign and construct Comparer once and use it. But the debugger keeps jumping to the line to xComparison := CompareIDs; while doing binary search.   I assume this is the cause for slower execution?