gem/nhlib — pull request #93 by larsbutler (2012-12-28 18:01:55+00:00)
Title: Optimization for SiteCollection.expand()

Replaced numpy.put statement with an equivalent array assignment.

numpy.put was showing up a profiling report and was found to be a major
bottleneck, consuming 1-2ms per call. For a test computation on 1 source
with a SiteCollection containing 95k sites, 82% of the time was spent
on `put` calls.

The first profiling test ran in 6078.557 seconds. With this optimization,
the same test ran in 1107.623 seconds.

See the following bug for more information, including the test script and full profiling reports: https://bugs.launchpad.net/openquake/+bug/1094297