Qt's performance



  • I need to write a very fast client that could respond to a server that sends a lot of information 170 times per second. Client should read, process and respond to server as fast as possible. Most of process is on strings and primitive data-types. I don't know if Qt is suitable for this or not. I like to use Qt because it's really easy to use (in comparison with std). but I'm wondered about performance. People suggested me to use std instead of Qt. Some others said Qt's library isn't so much slower than std.

    What you suggest?



  • I can only teöll my opinio, but I never tried.

    Qt is more comfortable, so I would prefer it and give it a shot. Make an easy test to check, whether it is fast enough or not.



  • The Qt equivalents to a lot of STL stuff are as quick or even quicker than their STL counterparts. Since QString is a unicode beast, you might run into some speed issues, but that is very dependent on what the contents of the strings are. As long as you don't have localization in your strings (plain ASCII that is) you could probably do most using a QByteArray instead anyway, which may have the knack over std::string. Anyway, use QTestLib for a bit of benchmarking :)


  • Moderators

    You can always mix and match, too. So if you find Qt too slow for something and want to use STL instead, just do so:-)

    QByteArray should work for storing internationalized strings in utf8 format, too. Of course it is harder to work with the string contents that way.



  • Would be great with some wiki-content on different types of performance tips&tricks in Qt. For example, what is the best way to iterate different kind of collections, QString vs QByteArray, QImage vs QPicture vs QPixmap and I'm sure there are plenty of info on this topic that could be written on the wiki.



  • [quote author="Tobias Hunger" date="1299148411"]QByteArray should work for storing internationalized strings in utf8 format, too. Of course it is harder to work with the string contents that way.[/quote]The same goes for std::string, obviously.



  • Thanks :-)

    I'm going to play around Qt instead of std. I hope ipcs and strings of Qt could run fast enough...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.