On Sun, Feb 3, 2013 at 11:17 PM, Gael Varoquaux <
[email protected]> wrote:

>
>
> > Goal #4 causes speed penalties because allowing compile-time switching of
> > the distance function means it can no longer be inlined at compilation.
>
> I guess you mean 'run-time' and not 'compile-time'. How many metrics are
> there? Would it be an option to single out Euclidean and have this one
> run fast, with a slower route for the others?
>

Yes, I should have said run-time.  My goal would be to include all the
metrics from scipy.spatial.distance, which is about 20 or so.  I like the
idea of inlining the common case, while still making available the others
-- I'll give that a try.


>
> > The net result is that code using memory views and flexible metrics is
> > ~2-3 times slower than the current code, and ~4-6 times slower than a
> more
> > optimized version of the code.
>
> Do you know how the slowdown breaks down between #3 and #4?
>

I will have to check on this as well.  The reason this is taking so long to
profile is that the code is pretty involved, and each time I change
something it involves a lot of coding and debugging!

One question - would you see it as a problem to continue using raw data
pointers rather than switching to typed memoryviews?  The latter are nice
in some situations, and certainly aid in debugging, but I believe they come
with a speed penalty in this particular use case.


>
> Thanks a lot for working on this,
>
> Gaƫl
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to