pydata/pandas — pull request #9136 by qwhelan (2014-12-22 23:05:39+00:00)
Title: Remove codepath asymmetry in dataframe count()

@jreback I noticed a codepath asymmetry in core.frame.count that leads to a substantial difference in dropna() performance depending on the axis. Using the path ```df.dropna(axis=0)``` takes yields a 2.5-5x improvement.

```
$ python vb_suite/test_perf.py -b upstream/master -t HEAD -r "dropna" -S -n 30
Invoked with :
--ncalls: 3
--repeats: 30

-------------------------------------------------------------------------------
Test name | head[ms] | base[ms] | ratio |
-------------------------------------------------------------------------------
frame_dropna_axis1_any | 18.5493 | 101.6117 | 0.1826 |
frame_dropna_axis1_all | 48.0193 | 128.8197 | 0.3728 |
frame_dropna_axis0_any | 17.0240 | 17.3127 | 0.9833 |
frame_dropna_axis0_all | 43.1127 | 43.3304 | 0.9950 |
-------------------------------------------------------------------------------
Test name | head[ms] | base[ms] | ratio |
-------------------------------------------------------------------------------

Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234

Target [84ad341] : Remove codepath asymmetry in dataframe count()
Base [099a02c] : Merge pull request #9061 from behzadnouri/nan-pivot

pivot & unstack with nan in the index

count mean std min 25% 50% 75% max
frame_dropna_axis1_any 3 40.114509 54.044075 0.182551 9.365917 18.549283 60.080489 101.611694
frame_dropna_axis1_all 3 59.070599 64.932673 0.372764 24.196047 48.019330 88.419517 128.819704
frame_dropna_axis0_any 3 11.773351 9.345549 0.983328 9.003684 17.024040 17.168363 17.312686
frame_dropna_axis0_all 3 29.146001 24.379745 0.994976 22.053826 43.112675 43.221513 43.330352
```