On Wed, Feb 15, 2017 at 9:28 AM, Gibbs, Matt <mgi...@slac.stanford.edu> wrote:
> Hi All, > > I’m working on a Qt-based project to display rapidly updating information > from a control system. I want to display hundreds of signals, each > updating at about 10 Hz. As a performance test, I’ve thrown 500 Labels in > a grid layout, and fire a timer every 100 ms which calls setText on each > label. This ends up being surprisingly CPU-intensive: on reasonably modern > hardware (2012 MacBook Pro), I use 70% of one CPU. This doesn’t leave me > much overhead to do anything else. > > Are there any best practices to reduce CPU usage in this case? > Though I haven't checked to see whether or not this actually affects performance, I would suggest callint setTextFormat(Qt::PlainText) to avoid the need to inspect the string to determine whether it's rich text. Also, based on the image you shared, I'd guess that most of the values that are changing might be better displayed within QLineEdit widgets. You might find that QLineEdit has better performance because I suspect there is less to do in terms of laying out the text and such. Adam
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest