On Sun, Nov 23, 2014 at 8:33 AM, Nathann Cohen <nathann.co...@gmail.com> wrote:
> Hello everybody,
>
> I wrote a bruteforce Cython code recently (#17309) which spends most of its
> time on calls to qsort.
>
> This is normal, sorting is sort of the most expensive thing I do, but to
> call qsort you need to provide a comparison function. Now, as qsort is
> compiled in a library, the comparison function cannot be inlined inside of
> qsort and I suspect that it has a nontrivial cost (given how simple the
> comparison is).
>
> Thus, if I copy/paste the original code of qsort into my Cython file the
> code should be faster, only that is ugly.

Is it faster?  You could at least do the ugly copy/paste (or #include
so it can stay C code) and find out what the speedup actually is.
Only if there is a real speedup would you then follow up on this
question.

William

>
> Sooooooo... Do you know if there ais  way to re-compile my code along with
> the code of qsort without having to copy/paste it ?
>
> Thanks,
>
> Nathann
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to