Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Templates do help with performance. Look up the performance characteristics of qsort (C) vs std::sort (templatized C++ sort).


I tested both extensively lately and the performance was exactly the same (under Intel Compiler and Visual Studio) so probably those compilers found a way to optimize it. They both are much slower than hand coded version anyway so it doesn't really matter (link to implementation which beats standard qsort/std::sort performance by 2x/3x times (at least on my data): http://www.ucw.cz/libucw/doc/sort.html).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: