3 ms·
I tried having a very quick dig through your code, but I couldn't actually see what you were doing. Could you perhaps post a quick description, and the gains y
by CJefferson 15y ago
I tried having a very quick dig through your code, but I couldn't actually see what you were doing.
Could you perhaps post a quick description, and the gains you were seeing? I'm interested because if it isn't too hard it could always be ported into g++ / clang's libc++.
- shin_lao 15y agoIt should work to g++ easily, provided the usual "typename" adjustments. Basically I wrote each sort block as individual functors (partitioning, merging). You run that through a filter stack that decides what to do depending on the input size and the current recursion depth. It's faster (I think) because when the recursion depth is a compile-time value, the compiler can unroll the recursion. It's old code I wrote for Boost but never had the time to finish & submit. As I quickly read through it there's a couple of rough edges to polish.
- KaeseEs 15y agoFunction objects are not 'functor's. Please do not call them that. Functor is a word that has a specific meaning in category theory that winds up being relevant in some other programming languages (Haskell, ML and friends) and we don't need to shoot ourselves in the foot by overloading it with another meaning.
- shin_lao 15y agoA functor is another word for "function object". http://en.wikipedia.org/wiki/Function_object http://en.wikipedia.org/wiki/Function_object