Slow histo.Fill


I’m a bit of a speed freak, I was wondering if there is anything that can be done about this or is it better just to convert to C++.

In my loop histo.Fill takes about 10 times longer than the equivalent C++ call (even after eliminating the reference call hFill = histo.Fill).

Oh and I’m using TH2F (if that makes a difference)

Advance thanks,

oops sorry, the details:

Mac, Intel, root 5.14, python 2.5


psyco doesn’t work on MacOS-X, but otherwise that’d help with a cut in CPU time of 30-50% in histo loops. You can also program list contractions yourself, if the memory overhead is acceptable, and get psyco-like speeds. However, that will make your code less readable (IMHO, anyway).

Now for a factor of 10, the actual python code needs massaging in a way that it and PyROOT cooperate. E.g. that the loop is fixed, that return types can be ignore (presumably), that the in-parameter really is a double etc. It’s in interesting subject, but not an easy one. More in March (ROOT Workshop). In the mean time, yes, just wrap the inner loop in C++ (e.g. with ACLiC).