I was wondering what exactly you mean by "this allows an optimization when reading columns that are NULL". Could you elaborate on that?
Firstly, having a null bitmap removes the need for storing special 'NULL' values for fixed-length datatypes. Without the null bitmap, how can you tell whether a column is NULL?
That's easy for a variable-length column - just check the length. If it's zero, then the column is NULL.
[Edit] Ryan Stonecipher (the dev responsible for DBCC) pointed out that I'd forgotten the case of empty strings - thanks Ryan. In this case, an empty string also has a zero length so for varchar columns you'd need to use the fixed-length solution described below.
It's not so easy for fixed-length columns, which, as their name suggests, have a fixed-length so that trick doesn't work. The only solution is to define a special 'NULL' value, which limits the effective range of the datatype being stored.
Secondly, it saves CPU cycles. If there was no NULL bitmap, then there are extra instructions executed for fixed- and variable-length columns.
read in the stored column value (possibly taking a cpu data cache miss)
load the pre-defined NULL value for that datatype (possibly taking a cpu data cache miss, but only for the first read in the case of a multiple row select)
do a comparison between the two values
calculate the offset of the variable length array
read the number of variable length columns (possibly taking a cpu data cache miss)
calculate the position in the variable length offset array to read
read the column offset from it (possibly taking a cpu data cache miss)
read the next one too (possibly taking another cpu data cache miss, if the offset in step 4 was on the boundary of a cache line size)
compare them to see if they're the same
But with a NULL bitmap, all you have to do is:
read the NULL bitmap offset (possibly taking a cpu data cache miss)
calculate the additional offset of the NULL bit you want to read
read it (possibly taking a cpu data cache miss)
So, its about even for a lookup of a single fixed-length column, but for variable-length columns, and for multiple row selects, there's a clear advantage to having the NULL bitmap.