I can certainly add such references with a warning that this method is neither tested, nor supported by this package. One of the issues is for example that PyROOT is extremely slow in this case. It is so slow that it falls definitely into the time range where people think it's frozen and they will probably bug is with this.
A quick check in Lyon yields 8 minutes to create the pdf object and 8µs per lookup.
In case of jppy it's only 1 minute for creating the pdf and 1.85µs per lookup.
Here is the full output, I guess you are referring to those warnings?
I don't see any warnings from clang while compiling with pybind11 but those might just be suppressed, I'm not sure...
In[1]:importROOT...:jppd='/pbs/throng/km3net/src/Jpp/master/software'...:ROOT.gInterpreter.AddIncludePath(jppd)...:ROOT.gInterpreter.ProcessLine('#include "'+jppd+'/JPhysics/JPDF_t.hh"')...:Infileincludedfrominput_line_20:1:Infileincludedfrom/pbs/throng/km3net/src/Jpp/master/software/JPhysics/JPDF_t.hh:6:Infileincludedfrom/pbs/throng/km3net/src/Jpp/master/software/JTools/JSpline.hh:11:Infileincludedfrom/pbs/throng/km3net/src/Jpp/master/software/JTools/JResult.hh:8:/pbs/throng/km3net/src/Jpp/master/software/JLang/JAssert.hh:29:9:warning:'STATIC_CHECK'macroredefined[-Wmacro-redefined]#define STATIC_CHECK(expr) { JLANG::JAssert<expr>(); }^/pbs/throng/km3net/software/root/6.18.04/etc/../include/Math/StaticCheck.h:56:9:note:previousdefinitionishere#define STATIC_CHECK(expr, msg) \^Infileincludedfrominput_line_20:1:Infileincludedfrom/pbs/throng/km3net/src/Jpp/master/software/JPhysics/JPDF_t.hh:3:Infileincludedfrom/pbs/throng/km3net/src/Jpp/master/software/JTools/JMap.hh:6:/pbs/throng/km3net/src/Jpp/master/software/JTools/JElement.hh:44:10:warning:defaultedmoveassignmentoperatorof'JSplineFunction1D<JTOOLS::JSplineElement2S<double, double>, JCollection, JTOOLS::JResultPDF<double>, JTOOLS::JDistance<double> >'willmoveassignvirtualbaseclass'JFunctional<double,JTOOLS::JResultPDF<double>>' multiple times [-Wmultiple-move-vbase] struct JElement2D { ^/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/vector.tcc:337:16: note: in implicit move assignment operator for 'JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>' first required here *__position = _Tp(std::forward<_Args>(__args)...); ^/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/vector.tcc:306:4: note: in instantiation of function template specialization'std::vector<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>,std::allocator<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>>>::_M_insert_aux<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>>' requested here _M_insert_aux(__position, std::forward<_Args>(__args)...); ^/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_vector.h:989:16: note: in instantiation of function template specialization'std::vector<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>,std::allocator<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>>>::emplace<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>>' requested here { return emplace(__position, std::move(__x)); } ^/pbs/throng/km3net/src/Jpp/master/software/JTools/JCollection.hh:165:29: note: in instantiation of member function 'std::vector<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>,std::allocator<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>>>::insert' requested here i = container_type::insert(i, value_type(x, ordinate_type())); ^/pbs/throng/km3net/src/Jpp/master/software/JTools/JElement.hh:44:10: note: in instantiation of member function'JTOOLS::JCollection<JTOOLS::JElement2D<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>>,JTOOLS::JDistance<double>>::get' requested here struct JElement2D { ^/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_construct.h:103:11: note: (skipping 5 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all) std::_Destroy(std::__addressof(*__first)); ^/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_construct.h:103:11: note: in instantiation of function template specialization'std::_Destroy<JTOOLS::JElement2D<double,JTOOLS::JMultiMap<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>,JTOOLS::JMapList<JPolint0FunctionalGridMap,JTOOLS::JMapList<JPolint0FunctionalGridMap,JLANG::JNullType>>,JTOOLS::JDistance<double>>>>' requested here/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_construct.h:127:2: note: in instantiation of function template specialization'std::_Destroy_aux<false>::__destroy<JTOOLS::JElement2D<double,JTOOLS::JMultiMap<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>,JTOOLS::JMapList<JPolint0FunctionalGridMap,JTOOLS::JMapList<JPolint0FunctionalGridMap,JLANG::JNullType>>,JTOOLS::JDistance<double>>>*>' requested here __destroy(__first, __last); ^/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_construct.h:151:7: note: in instantiation of function template specialization'std::_Destroy<JTOOLS::JElement2D<double,JTOOLS::JMultiMap<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>,JTOOLS::JMapList<JPolint0FunctionalGridMap,JTOOLS::JMapList<JPolint0FunctionalGridMap,JLANG::JNullType>>,JTOOLS::JDistance<double>>>*>' requested here _Destroy(__first, __last); ^/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_vector.h:415:14: note: in instantiation of function template specialization'std::_Destroy<JTOOLS::JElement2D<double,JTOOLS::JMultiMap<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>,JTOOLS::JMapList<JPolint0FunctionalGridMap,JTOOLS::JMapList<JPolint0FunctionalGridMap,JLANG::JNullType>>,JTOOLS::JDistance<double>>>*,JTOOLS::JElement2D<double,JTOOLS::JMultiMap<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>,JTOOLS::JMapList<JPolint0FunctionalGridMap,JTOOLS::JMapList<JPolint0FunctionalGridMap,JLANG::JNullType>>,JTOOLS::JDistance<double>>>>' requested here { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, ^/pbs/throng/km3net/src/Jpp/master/software/JTools/JCollection.hh:71:9: note: in instantiation of member function 'std::vector<JTOOLS::JElement2D<double,JTOOLS::JMultiMap<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>,JTOOLS::JMapList<JPolint0FunctionalGridMap,JTOOLS::JMapList<JPolint0FunctionalGridMap,JLANG::JNullType>>,JTOOLS::JDistance<double>>>,std::allocator<JTOOLS::JElement2D<double,JTOOLS::JMultiMap<double,JTOOLS::JSplineFunction1D<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>,JTOOLS::JMapList<JPolint0FunctionalGridMap,JTOOLS::JMapList<JPolint0FunctionalGridMap,JLANG::JNullType>>,JTOOLS::JDistance<double>>>>>::~vector' requested here class JCollection : ^/pbs/throng/km3net/src/Jpp/master/software/JTools/JSpline.hh:658:5: note: 'JFunctional<double,JTOOLS::JResultPDF<double>>' is a virtual base class of base class 'JSplineFunction<JTOOLS::JSplineElement2S<double,double>,JCollection,JTOOLS::JResultPDF<double>,JTOOLS::JDistance<double>>' declared here public JSplineFunction<JElement_t, JCollection_t, JResult_t, JDistance_t>, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/pbs/throng/km3net/src/Jpp/master/software/JTools/JSpline.hh:659:5: note: 'JFunctional<double,JTOOLS::JResultPDF<double>>' is a virtual base class of base class 'JFunction1D<typenameJSplineElement2S<double,double>::abscissa_type,JTOOLS::JResultPDF<double>>' (aka'JFunction1D<double,JTOOLS::JResultPDF<double>>') declared here public JFunction1D<typename JElement_t::abscissa_type, JResult_t> ^Out[1]: 0In [2]: %time pdf = ROOT.JShowerPDF_t("/pbs/throng/km3net/src/Jpp/v12.1.0/data/J ...:%p.dat", 1.5 )loading input from file /pbs/throng/km3net/src/Jpp/v12.1.0/data/J14p.dat... OKloading input from file /pbs/throng/km3net/src/Jpp/v12.1.0/data/J13p.dat... OKbluring PDFs... OKCPU times: user 7min 50s, sys: 6.78 s, total: 7min 57sWall time: 7min 52sIn [3]: %timeit result = pdf.calculate(1000, 100, 0.5, 0.1, 0.1 , 100 )8.19 µs ± 987 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
In[1]:importjppyIn[2]:%timepdf=jppy.pdf.JShowerPDF("/pbs/throng/km3net/src/Jpp/v12.1.0/data ...:/J%p.dat", 1.5)loading input from file /pbs/throng/km3net/src/Jpp/v12.1.0/data/J14p.dat... OKloading input from file /pbs/throng/km3net/src/Jpp/v12.1.0/data/J13p.dat... OKbluring PDFs... OKCPU times: user 1min 7s, sys: 2.56 s, total: 1min 10sWall time: 1min 9sIn [3]: %timeit result = pdf.calculate(1000, 100, 0.5, 0.1, 0.1 , 100)1.85 µs ± 232 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
In this cases, the speed difference is not due to PyROOT (at least not the one
for initializing the PDFs). It may be because code included in this way is
compiled in ROOT without optimization. I'll have a quick look if something
can be done about that.
I asked about the warnings since -- of course I saw them, but I'm not
sure if they point to genuine issues of the code. It seems they could
be valid warnings..
In case you care, it's indeed the ROOT JIT (cling) that is not optimizing (mucb).
The following (unpolished) example uses a normal compiler and has theretofore similar
speed as native code. Pyroot is still inbetween the call to calculate(), but its at
2.4 us, so not bad..