Hi experts, I have a some code which plays with TTrees with std::vector branches, and a common operation is finding the length of such a vector. Is it more efficient to use the python built-in len() function, or the v.size() method of the vector?
I did try to write a simple script with cProfile to see the difference, but I got inconclusive results: 0.001 vs 0.002 seconds for getting the length of a bunch of huge vectors. In the end I think I might have been profiling python’s ability to loop over a list of vectors instead of the actual len() vs .size()…
Jean-François