Jasonwong
Links: http://www.zhihu.com/question/37444226/answer/72007923
Source: Know
Copyright belongs to the author, please contact the author for authorization.
~~~~~ Graphics Performance Section ~~~~~
QT Widgets part, the operation of the image rendering performance is general, because most of the interface content is QT self-painting, no hardware acceleration, that is, a lot of graphics content is CPU calculated.
But widgets bottom is C + +, and QT module is also good, do a lot of optimization, the performance of this rendering on the desktop with a hardware-accelerated frame than the difference, unless there are a lot of animation complex scenes to see the difference.
However, on the phone or embedded, it is obvious that widgets rendering performance is low.
So what to do, QT will not be held in widgets a frame. So QT launched the quick and qml.
Quick is hardware-accelerated, available on all platforms, and supports OpenGL or Openes. Graphics rendering performance is very powerful.
And the framework itself is a class JS development language QML, the development efficiency is very high.
QT is currently developing controls2.x, which is the main control library in quick, and the 1.x performance is multiplied by the present.
Some people say that quick loading is slow, I want to say, the QML files (including controls these library level) directly compiled into the QRC file, and then open the QML compiler, loading speed of 66.
~~~~~ Network Performance Section ~~~~~
First, the TCP part of the server, is Qtcpserver
The performance of this module is not strong, even the medium level of performance can not reach (c + +).
This is mainly reflected in two parts, the first is low concurrency, which is related to the event loop of QT, more than 800 long links are not stable, super 1000 basic can not be used normally. The second is the low performance of data transmission, about the transmission of equal amounts, more than ASIO at least one CPU occupied.
But after all, C + +, performance compared to other languages is still possible, the development of small-scale server, is no problem.
Besides, the UDP server is qudpsocket.
A period of time to do a project, require UDP to receive a large amount of data, is 1400 bytes per packet of data, 4w per second packet, approximately equivalent to 500M of bandwidth.
Then I use QT to do development, and then various drops, and finally simplified to a separate thread dead loop receive, after receiving even do not do any processing directly back to receive the next package. In this way, you can only receive about 7,000 per second.
Well, this lost more than 80%, Pro, not to force AH.
Then change the ASIO, also can only receive 1.3w, Pro, or not to force AH.
Later changed the WinPcap, easy to take 4w and one does not lose, finally to force.
Graphics performance (widgets rendering performance is too low, so the QML, Go Hardware acceleration) and network performance (the performance of the UPD is measured data support)