查到一篇 sort 比 qsort 快
https://www.geeksforgeeks.org/c-qsort-vs-c-sort/這一篇有 Ian Lance Taylor 的簡報連結
https://lwn.net/Articles/542457/整理一下第一個連結,以 sort, qsort 為例子。C++ STL sort 用 template 實踐可以在 compile time 生出程式碼,讓編譯器最佳化。C 的 qsort 因為 comparator 需要傳入 function pointer ,所以無法在 compile time 最佳化。從第二個連結看來 Ian 應該是指需要擔心效能的地方一樣用 C寫,其餘用 C++ 好維護。