socialcast/socialcast-command-line — pull request #39 by f1sherman (2014-06-02 18:45:48+00:00)
Title: Performance improvements

Address some performance issues
* Avoid reconnecting to LDAP for each search by using `LDAP#open` (http://net-ldap.rubyforge.org/Net/LDAP.html#method-c-open)
* Don't request/include profile photo data for provisioning
* Don't request unnecessary fields for profile photo sync
* Pre-fetch dn/email mapping per connection so that we don't have to do a lookup for each manager (benchmark below)

Also fix a couple bugs I found along the way:
* Profile photo sync would make n^2 updates (n == number of ldap connections)
* An error would be raised if no `options` hash is included in the config file
* No more users would have profile photos uploaded once one is encountered that is not set to the community default

_Benchmark for pre-fetching manager info_

Setup: Measured time to generate the XML file for 20,000 users in a local ldap instance, 1 manager for each 4 employees. Also checked to make sure the xml files generated were identical.

```
# Before
real 2m41.238s
user 0m29.530s
sys 0m4.480s

# After

real 0m18.282s
user 0m17.629s
sys 0m0.246s
```