Is there any method to improve sorting performance on stxxl vector over in memory vector sorting.

  • Anonaz09

    Anonaz09 - 2014-02-19

    I am using a Stxxl vector containing some strings with fixed size(say 260 bytes) and in its comparator function I am getting the string elements from vector and compare them and returning the Boolean result. Am I doing something wrong as this is very slow as compared to in memory vector and its sorting?

  • Timo Bingmann

    Timo Bingmann - 2014-02-20

    Currently, for in-memory sorting the usual std::sort (or on Linux the __gnu_parallel::sort) method is used. Maybe you didnt expect the parallel sort? Otherwise, I don't know, since the sorting methods are the same.

    Maybe someone should check that the comparator function is actually inlined in std::sort()'s introsort implementation, without an extra function call to the comparator. Such a function call would be expensive.


Log in to post a comment.