DCSIMG
PerformanceBook - All Your Base Are Belong To Us

All Your Base Are Belong To Us

Mostly .NET internals and other kinds of gory details

Browse by Tags

All Tags » PerformanceBook (RSS)
Runtime Representation of Generics—Part 2
This is an excerpt from Chapter 5 (Collections and Generics) of Pro .NET Performance , scheduled to appear in less than a month. I might be publishing a few more of these before and after the book is out. After giving ample consideration to the design of Java generics and C++ templates, we can understand better the implementation choice for CLR generics. CLR generics are implemented as follows. Generic types — even open ones, like List<> — are first-class runtime citizens. There is a method...
Runtime Representation of Generics—Part 1
This is an excerpt from Chapter 5 (Collections and Generics) of Pro .NET Performance , scheduled to appear in less than a month. I might be publishing a few more of these before and after the book is out. Before we can concern ourselves with the runtime implementation of generics, it’s paramount to ask whether there is a runtime representation of generics—as we will see shortly, C++ templates, a similar mechanism, have no runtime representation to speak of. This question is easily answered if you...
Micro-Benchmarking Done Wrong, And For The Wrong Reasons
This is a short excerpt from Chapter 2 (Performance Measurement) of Pro .NET Performance , scheduled to appear in August 2012. I might be publishing a few more of these before and after the book is out. The purpose is to determine “which is faster”—using the is keyword and then casting to the desired type, or using the as keyword and relying on the result. Here’s a test class for this comparison I’ve seen lately: //Test class class Employee {   public void Work() {} } //Fragment 1 – casting...
Choosing a Collection Is a Matter of Cache, Too
This is a short excerpt from Chapter 5 (Collections and Generics) of Pro .NET Performance , scheduled to appear in August 2012. I might be publishing a few more of these before and after the book is out. Choosing the right collection is not only about its performance considerations. The way data are laid out in memory is often more critical to CPU-bound applications than any other criterion, and collections affect this layout greatly. The main factor behind carefully examining data layout in memory...
Performance Gains with Data Parallelism: Using SIMD Instructions from C#
This is a short excerpt (with slight modifications) from Chapter 10 of Pro .NET Performance , scheduled to appear in August 2012. I might be publishing a few more of these before and after the book is out. Theoretically, .NET developers should never be concerned with optimizations tailored to a specific processor or instruction set. After all, the purpose of IL and JIT compilation is to allow managed applications to run on any hardware that has the .NET Framework installed, and to remain indifferent...
“Fitting” Performance into the Software Development Lifecycle
This is a short excerpt from Chapter 1 of Pro .NET Performance , scheduled to appear in August 2012. I might be publishing a few more of these before and after the book is out. We have an Amazon page and a cover image now! Where do you fit performance in the software development lifecycle? This innocent question carries the mind baggage of having to retrofit performance into an existing process. Although it is possible, a healthier approach is to consider every step of the development lifecycle an...
Pro .NET Performance
It is customary to apologize for a prolonged blog silence, so here goes: I’ve been very busy with three extremely interesting projects, one of which is the SELA Developer Practice that is very near. Here’s another: It’s been more than five years since I wrote a SELA course called Effective C#, which quickly turned to another course called .NET Performance . Since then, I trained this course dozens of times, spoke about performance optimization at conferences, delivered a one-day summary at several...