C++ std::sort will be able to inline the comparator.
Is gprof enough powerful with modern architectures on such programs? from my point of view, no.
There are non free, commercial, tools like vtune which can do fantastic measurement job. Vtune shows, for example, that a call to std::copy is not as fast as a for loop, which is turned by the compiler in a memcopy (probably std::copy is not!). I do not think we can see this with gprof.
But ok, you are not supposed to buy vtune...
What about likwid https://code.google.com/p/likwid ? It is free. Did somebody used it to measure cython code performances?
Likwid (and Vtune) have in common to use performance counters on Intel and AMD processors (not sure for AMD with Vtune...).
What is the size of what you are sorting ? If it is small enough to fit in the caches, and better in the L1 cache, you can possibly improve something with your modification, but otherwise it is certainly memory bounded and you cannot do much...
You have to measure the bandwidth of your program. Vtune does this, possibly likwid too.
There's a sort.h library you should be able to include that will have quick sort + many others, and will allow the compiler to properly inline functions. https://github.com/swenson/sort (disclaimer: I wrote it). I get about a 10x speed improvement over qsort just for the ability to inline functions.
I've never used it with Cython, but I don't believe there should be any problems doing so.
--
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+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
But what about the quick sort? is it sure that the implementation cannot degenerate? it is well known all the efficiency can be lost if the "key" used for partition is not chosen as it should be... What about replacing the quick sort by an other method ? (the tree based one?).
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.