The Cost of Optimization

Imagine you were to write a query as follows:

image

It’s most likely not immediately apparent to you this is carrying out a filtering operation as well as a grouping operation, let alone that the runtime would be able to see our intent from the rather complex preceding code. Also because you’ve prescribed the recipe to execute your algorithm very precisely, you’ll most likely not want the runtime or compiler to start messing with the code in an overly smart way.

One of the main concepts exploited in imperative programming languages is the use of sequencing to control execution order or statements and elevation order of expressions. ...

Get C# 4.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.