summaryrefslogtreecommitdiff
path: root/test/matrix_test.py
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-10-07 15:51:47 -0400
committerStan Seibert <stan@mtrr.org>2011-10-07 15:51:47 -0400
commitc13c687cc1c3fed4484be2a19fc045cee7b3d310 (patch)
treed6f6d5a4d17021eb2b0270bb7d16af1a038e1be6 /test/matrix_test.py
parentd0a7ec169cbb3bf19024b6f9d337845e706b4fa2 (diff)
downloadchroma-c13c687cc1c3fed4484be2a19fc045cee7b3d310.tar.gz
chroma-c13c687cc1c3fed4484be2a19fc045cee7b3d310.tar.bz2
chroma-c13c687cc1c3fed4484be2a19fc045cee7b3d310.zip
Speed up Geometry.build() by a large factor when loading from cache.
A bunch of small tricks have been applied to reduce the amount of time required to build an already cached geometry: * Replace uses of fromiter() on long sequences with code that operates on bigger arrays. * Use memoization on the Solids to more efficiently map materials to material codes when a solid is repeated (as is the case in all our detectors) * Use numpy.take() instead of fancy indexing on big arrays. I learned about this trick from: http://wesmckinney.com/blog/?p=215 Also, switched over to compressed npz files for storing cache information. They take the same size as the gzipped pickle files, but load 30% faster.
Diffstat (limited to 'test/matrix_test.py')
0 files changed, 0 insertions, 0 deletions