1월 11일
Issues with .NET Frameworks 2.0
Our team is tackling the scale issues, delving deep into the CLR and understanding its behavior. We've identified at least two issues in .NET Frameworks 2.0 that are "low-hanging fruit", and are hunting for more.
1a) Regular Expressions can be very expensive. Certain (unintended and intended) strings may cause RegExes to exhibit exponential behavior. We've taken several hotfixes for this. RegExes are so handy, but devs really need to understand how they work; we've gotten bitten by them.
1b) Designing an AJAX-style browser application (like most engineering problems) involves trading one problem for another. We can choose to shift the application burden from the client onto the server. In the case of RegExes, it might make sense to move them to the client (where CPU can be freely used) instead of having them run on the server (where you have to share). WindowsLive Mail made this tradeoff in one case.
2) Managed Thread Local Storage (TLS) is expensive. There is a global lock in the Whidbey RTM implementation of Thread.GetData/Thread.SetData which causes scalability issues. Recommendation is to use the [ThreadStatic] attribute on static class variables. Our RPS went up, our CPU % went down, context switches dropped by 50%, and lock contentions dropped by over 80%. Good stuff.