On 21 June 2012 01:22, Peter Geoghegan <pe...@2ndquadrant.com> wrote: > I've written a very small C++ program, which I've attached, that > basically proves that this can still make a fairly large difference - > I hope it's okay that that it's C++, but that allowed me to write the > program quickly, with no dependencies for anyone who cares to try this > out, other than a C++ compiler and the standard library.
So, it turns out that with a relatively expensive to sort collation like hu_HU.UTF-8, the difference here is huge: [peter@peterlaptop strxfrm_test]$ ./a.out locale set: hu_HU.UTF-8 Time elapsed with strcoll: 11.122695 seconds Time elapsed with strxfrm optimization: 2.328365 seconds Time elapsed with strcoll: 11.404160 seconds Time elapsed with strxfrm optimization: 2.355684 seconds Time elapsed with strcoll: 11.411680 seconds Time elapsed with strxfrm optimization: 2.342553 seconds Time elapsed with strcoll: 11.415693 seconds Time elapsed with strxfrm optimization: 2.343593 seconds Time elapsed with strcoll: 11.428686 seconds Time elapsed with strxfrm optimization: 2.345204 seconds *****strcoll average: 11.356583 strxfrm average: 2.343080***** -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers