pydata/pandas — comment on commit 4ec8e40affd7028a78b9472bf3ad5ac69ca63f91
File: pandas/src/datetime.pyx line 1621
By adamklein:

Answer: much faster to do datetimestruct (I added Year to test with the old method). It's trivial to build a structured dtype cache. Should take 10 mins... I'll do it to compare.

In [4]: dti = DatetimeIndex(start=datetime(2005,1,1), end=datetime(2006,1,1), offset='Min')

In [5]: dti
Out[5]:

offset: Min, tzinfo: None
[2005-01-01 00:00:00, ..., 2006-01-01 00:00:00]
length: 525601

In [6]: %timeit dti.year
10 loops, best of 3: 114 ms per loop

In [7]: %timeit dti.Year
10 loops, best of 3: 24.2 ms per loop