View Full Version : Using QT libraries means slower perfomance ?

20th September 2010, 16:57
If I use QString methods, my program are going to be slower that if I use String STL lib ?

20th September 2010, 17:01
QString will be in many cases a bit slower than std::string because it operates on Unicode strings and not 8-bit strings but in other cases it will be faster because of better algorithmics and API. So the bottom line is that it depends on the usecase.

20th September 2010, 17:18
That's a great way of entering a Qt community :->

I recommend to optimize for performance only, where it matters. If something scales with the input and there is something to gain from a performance boost.

That is rarely going to be string handling. I just wrote a small qt application reading all my source code/text files into memory and make them searchable. With hundreds of MBytes of QStrings this is still blazing fast. I qCompress'ed them in memory to keep memory usage acceptable, because obviously otherwise Unicode blows everything up quite a bit.

Otherwise optimize code readability. That will leave you more time to do important stuff.