Minuit2 much slower than Minuit

In an application using ROOT v5.20 built with VS 8.0 for Windows, I replaced Minuit with Minuit2 (include libraries, header files, and Minuit commands with equivalent calls from class TFitterMinuit). The results are comparable, but the code became ~2.5 times slower. Does this match benchmark comparisons between the two packages? If so are there any computational incentives to use Minuit2 rather than Minuit? (apart from Minuit2 being OO, which may make first time development easier but doesn’t matter for existing code that uses Minuit and already has all the required static structures in place)

Your numbers match quite wel our results with eg $ROOTSYS/test/stressMinuit where we observe similar results.
We would like to get more feedback from the use of TMinuit2 (results & time).
It is clear that we are not planning to replace TMinuit by TMinuit2 for the time being.

Rene

The number is correct only when the time spent in evaluating the function to be minimized is negligible compared to the time spent inside Minuit itself.
In any typical fitting application, the time spend in evaluating the function is much larger and therefore no significative difference in CPU time will be observed. See for example the tutorial fit/minuit2FitBench.C.
This slower time is due to the fact that Minuit2 mantains the history of all the iterations, which can be retrieved for debugging information by the user.
In addition, Minuit2 provides currently some extra functionality, like the possibility of constraint the parameters on semi-defined intervals (like par > a or par < b).
In one of the next versions it will provide the possibility of parallelizing the minimization by evaluating the function gradients on separate CPU core’s.
Best Regards

Lorenzo

Thanks for the feedback. Whatever the cause, the slowing down is real, so it looks like Minuit2 is not quite yet in production mode.

I should have also said that I get comparable results between Minuit and Minuit2 only when both converge. For a large number of cases I get Minuit to converge to reasonable parameter sets, while Minuit2 exits erratically with suboptimal values.

I would be very grateful if you can you send me the program reproducing one of this cases, where TMinuit converges and Minuit2 no, so I can investigate the cause.
I assume you are seen this using the latest version, 5.20.

Thank you

Lorenzo