mongodb/mongo-hadoop — pull request #58 by bpfoster (2012-08-22 03:53:31+00:00)
Title: Don't initialize cursor and encoder during constructor.  This improves p...

...erformance of input split calculation.
Calling getCursor() in the constructor for every split is slow, especially when auth is enabled. getCursor subsequently calls MongoConfigUtil.getCollection() which in the case of an authenticated cluster, causes an authentication to happen for each split. In an example case of 572 splits, calculation of splits went from 20-30 seconds to < 1 second. The eager loading of the cursor seems pointless anyway, since the splits are serialized out to the processing nodes before any records are pulled.