|
|
|
|
|
by chrisseaton
2622 days ago
|
|
> C# generally follows the same approach as Java, but tries to perform more aggressive optimizations. I don't understand this when it doesn't have deoptimization? The Java example has one condition for fast path, while the C# has two nested loops and a condition inside that! |
|
But what about the worst case – the method lookup when the method is not in the cache? There, the CLR introduces an additional level of indirection for calls through interface types, which has benefits for memory usage and possibly dispatch time. But since this is the worst case, the complexity doesn't matter that much as long as the important cases (which can be cached) work well.