Performance
There are 8 entries for the tag Performance

I've just been in New York, and they've instituted what I believe to be an absolutely brilliant law: all restaurants have to show the calorific content of the items on the menus.  It's seriously hard to see how you could be against it: it simply provides more information to the consumer. The interesting thing about this is how I spotted myself responding to it: I saw the calorific content as the price.  I paid almost no attention to how much the order would cost (unless you're on the knife edge, you don't) but calories: one way or another I'm...

I never really intended to start blogging about my work kitchen, but it keeps providing me with anecdotes.  Today, I was thinking about the milk.  There are six fridges in the office, and typically you'll find that they each have eight semi-skimmed jugs of milk.  There's also a single jug of skimmed milk.  Sometimes there's none.  So, someone somewhere has made a decision as to the appropriate amount of skimmed and semi-skimmed milk to provide.  Now we enter the realms of pure speculation, but bear with me. How do you determine what the mix should be? ...

I've got about 500 CDs, and they're in a complete mess.  So, I want to sort them.  What sort algorithm would you use?  Ask a computer science graduate and he'd tell you that heapsort is the single threaded algorithm of choice.  If you had people helping you, you could consider mergesort.  Of course, neither of these approaches is actually sensible.  Here's an idea that actually works: First go through the CDs and sort them into buckets according to the first letter. Insertion sort the CDs belonging to a particular letter. ...

Lazy<T> is a new class in .NET 4, but I imagine most developers have been running their own versions for years.  It's used to avoid the fetching of expensive resources.  However, the fundamental assumption is that it's the fetching of T that is expensive.  Assume, instead, that the cost of fetching/calculating T isn't your main concern, but the memory storage cost.  For this, you want something with slightly different characteristics: T is computed when needed. T is cached T is thrown away if the memory is at a...

Dan North once described an advanced beginner as someone who makes all the mistakes an advanced beginner makes.  It doesn't matter if you warn them about the mistake or not, they'll still make it.  This post is about one of those problems.  Hopefully someone will find it useful, but what I know of the Dreyfus model suggests that it'll only be useful after something fails in production. Here's the problem: let's say you have a process.  It's fairly easy to divide into two parts.  The first, A, is fast and feeds the second, B, which is slow.  So, you...

My previous article emphasized that you shouldn't mix clustered indexes and identity fields.  However, if you're using NHibernate you already probably know you shouldn't be using identity fields.  On the other hand, the points still generalize to some of the NHibernate generators: Increment: just as bad as identity HiLo:  better than identity, but not by much.  Don't mix with a clustered index. GUID:  Extremely random.  In fact, probably too random.  The inserts get plastered everywhere and can hurt performance. GUID Comb: Better than GUID, ...

We've already talked about how a level of an index looks a lot like a table.  Clustered indexes take this to the logical conclusion: they use the actual table as the leaf nodes of the index.  This means that we save a whole level of the index, which makes it faster than a non-clustered index.  (That's providing you need columns not in the index.  Otherwise index covering is typically faster.)  It also means that you've actually ordered the table according to the index. The ordering of the actual table is huge, and the ramifications are large.  The simplest, and...

Okay, first off, there hasn't been a post in, conservatively forever.  There have been a number of reasons for this: holidays, people visiting during the weekend (when I write this blog) and swine flu are probably the top three.  That and I managed to lose my post on Liskov, so I'm going to have to re-write.  But anyway, I thought that more than one person I know could do with reading a quick guide to SQL Server indexes. Basics of SQL Server Performance The first thing you need to know about is pages.  SQL Server puts rows onto...