I can't really see anyone else being able to use this. The original implementation is only faster because I know that I'll be comparing the same vectors many times, so I can precompute the expensive things (like the z scores and the standard divs). It's only useful in a small number of cases and is a trivial thing to implement.

As for the C stuff, I don't know anything about XS (though it seems like it's not easy) so I couldn't really provide a Perl interface to it. What I am doing is preprocessing the data into an easily digestible format in Perl then just packing it and piping it to the script I posted; the script will also need to collect the results, do a bunch of sorting - I only need the top couple hundred values for each vector - and probably dump them to a file that a perl script then will load into a database.

So, I minimize the time I spend in C and still remove the huge (quite an understatement there) bottleneck. I'm afraid I don't have the time or the knowhow to package this for external consumption.


In reply to Re^2: PDL vs C speed question by glwtta
in thread PDL vs C speed question by glwtta

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.