I just pushed a really simple script to this branch (devel/testlinecounting.py) that tests 3 methods of line-counting, 2 I found on Stack Overclow and 1 with numpy.loadtxt, on files that were already in the GalSim distribution.  There's a buffered method that works faster on both my machines than loadtxt or simple line counting, but please add your own methods if you like.