lucabaldini / pyxpe

Python utilities for the X-ray Polarimetry Explorers
GNU General Public License v3.0
0 stars 0 forks source link

Benchmark simulation speed #13

Open csgro opened 8 years ago

csgro commented 8 years ago

Need to identify possible bottleneck in simulation (loops, random number extraction, etc.). and improve them. Also related to issue #11

csgro commented 8 years ago

Here a first check on speed with 100 events (running experiment.py without plots): Nevt, Time (s), Rate (Hz)- Note 99 20.8040440083 4.80675776115 - with diffusion as multivariate gaussian and exp_in_range 99 12.003002882 8.33124852031 - without diffusion at all and exp_in_range 99 19.9677729607 5.00806976306 - with old exp alg with a 'while' loop is faster! 99 12.2789461613 8.14402137501 - with diffusion with loop!

First conclusions: my attempt to be 'clever' failed since wile loop are usually faster than numpy complex algorithm. In particular the multivariate gaussian takes ~half of the simulation time.