Hello Pamphile, The problem is that your sample case is small, so the conversion from a numpy array into an OT Sample has a significant cost. If you rerun your benchmark on otsample = ot.Sample(sample) (or directly generate a random sample with OT), you will see that our version is much faster.
BTW I was intrigued by your results with numba, but could not achieve the same speedup, my gain is almost negligible. Can you please show your test case with numba? Did you use a GPU? Regards, Denis 2017-06-14 10:32 GMT+02:00 roy <[email protected]>: > Hi, > > Thanks for the feedback, indeed that could explain the behaviours. > > > Pamphile ROY > Chercheur doctorant en Quantification d’Incertitudes > CERFACS - Toulouse (31) - France > +33 (0) 5 61 19 31 57 > +33 (0) 7 86 43 24 22 > > > > Le 14 juin 2017 à 10:15, HADDAD Sofiane <[email protected]> a écrit : > > Hi, > > It also depends on sample size > > With sample's size=1000, I get this : > > 0.00975831343631 > 0.009758313432154839 > Function time: [19.408187157008797, 21.296883990988135, 19.92589810100617] > OT time: [4.125010760006262, 4.1429947539872956, 4.138353090995224] > > For small samples, maybe we spend more time for the generation of small > objects than the evaluation itself > > Regards, > Sofiane > > > Le Mercredi 14 juin 2017 0h22, D. Barbier <[email protected]> a écrit : > > > On 2017-06-13 12:01 GMT+02:00 roy wrote: >> Hi everyone, >> >> I was playing with Centered discrepancy and wrote my function before I saw >> the class SpaceFillingC2. >> There is no issue except that I get 2x speedup with my python version. >> There >> might be room for improvement as I can even get a 10x on my version using >> numba. > [...] > > Hello Pamphile, > > I will have a look, thanks a lot for your feedback. > Regards, > > Denis > > _______________________________________________ > OpenTURNS users mailing list > [email protected] > http://openturns.org/mailman/listinfo/users > > > _______________________________________________ OpenTURNS users mailing list [email protected] http://openturns.org/mailman/listinfo/users
