title: QThread and pyqtgraph no performance improvement
body: <p>I am trying to do a multigraph window for plotting different data using pyqtgraph. I have a working version with no threads using timers for getting the data. I also tried a threaded version but it seems to have no performance boost when use htop for visually inspecting the CPU Usage. </p>
  
  <p>I am new to GUIs and Threads so I followed this code that I saw in a youtube tutorial. It uses a QThread to get the CPU usage using <code>psutil.cpu_percent</code> in intervals of 0.1 seconds and then updates a progress bar. </p>
  
  <pre><code>import sys
  from PyQt4 import QtCore
  from PyQt4 import QtGui
  import progress
  import sysinfo
  
  class MainUIClass(QtGui.QMainWindow, progress.Ui_MainWindow):
      def __init__(self, parent = None):
          super(MainUIClass, self).__init__(parent)
          self.setupUi(self)
          self.threadClass = ThreadClass()
          self.threadClass.start()
          self.connect(self.threadClass, QtCore.SIGNAL('CPU_VALUE'),
                       self.updateProgressBar)
  
      def updateProgressBar(self, val):
          self.progressBar.setValue(val)
  
  
  class ThreadClass(QtCore.QThread):
      def __init__(self, parent = None):
          super(ThreadClass, self).__init__(parent)
  
      def run(self):
          while 1:
              val = sysinfo.getCPU()
              self.emit(QtCore.SIGNAL('CPU_VALUE'), val)
  
  if __name__ == '__main__':
      a = QtGui.QApplication(sys.argv)
      app = MainUIClass()
      app.show()
      a.exec_()
  </code></pre>
  
  <p>I tried using cProfile for comparing performance but it throws lot of stuff that couldn't read, so I use the example of the progress bar to average the cpu usage after 10 seconds. Sorry if my measure performance method is so poor. </p>
  
  <p>My two codes for benchmarking are</p>
  
  <p>Threaded Version with a very consistent average CPU Usage of 64%:</p>
  
  <pre><code>import sys
  from pyqtgraph.Qt import QtCore
  from pyqtgraph.Qt import QtGui
  import pyqtgraph as pg
  import numpy as np
  import time 
  
  class GraphWindow_Thread(pg.GraphicsWindow):
      def __init__(self, rows, cols, titles):
          super(GraphWindow_Thread, self).__init__()
  
          # Code to draw the GUI
          self.rows = rows
          self.cols = cols
          self.titles = titles
          self.plots = [] # List of PlotItems
          self.curves = [] # List of PlotDataItems in each PlotItem
  
          for i in range(self.rows):
              for j in range(self.cols):
                  p = self.addPlot()
                  self.plots.append(p)
                  if titles != [] or len(titles) == 1:
                      p.setLabel('left', self.titles[i+j+1])
                  p.setDownsampling(mode='peak')
                  p.setClipToView(True)
                  pp = p.plot(pen=(155, 255, 50))
                  pp1 = p.plot(pen=(55, 130, 255))
                  self.curves.append((pp, pp1))
              self.nextRow()
  
          # Thread to get the data and redraw plots
          self.thread_graph = DataThread()
          self.thread_graph.start()
          self.connect(self.thread_graph, QtCore.SIGNAL('DATA_VALUE'),
                       self.update_plots)
  
      def set_titles(self, titles):
          for i, p in enumerate(self.plots):
              p.setLabel('left', titles[i])
  
      def update_plots(self, data, dataD):
          for curve in self.curves:
              curve[0].setData(data)
              curve[1].setData(dataD)
  
  
  class DataThread(QtCore.QThread):
      def __init__(self, parent = None):
          super(DataThread, self).__init__(parent)
  
      def run(self):
          while 1:
              data = np.random.random((30,))
              dataD = np.random.random((30,))
              self.emit(QtCore.SIGNAL('DATA_VALUE'), data, dataD)
              time.sleep(.1)
  
  if __name__ == '__main__':
      app = QtGui.QApplication(sys.argv)
      gui = GraphWindow_Thread(2,3,[])
      gui.show()
      app.exec_()
  </code></pre>
  
  <p>No Thread Version with a very consistent average CPU Usage of 65%:</p>
  
  <pre><code>import sys
  from pyqtgraph.Qt import QtCore
  from pyqtgraph.Qt import QtGui
  import pyqtgraph as pg
  import numpy as np
  import time 
  
  class GraphWindow(pg.GraphicsWindow):
      def __init__(self, rows, cols, titles):
          super(GraphWindow, self).__init__()
  
          # Code to draw the GUI
          self.rows = rows
          self.cols = cols
          self.titles = titles
          self.plots = [] # List of PlotItems
          self.curves = [] # List of PlotDataItems in each PlotItem
  
          for i in range(self.rows):
              for j in range(self.cols):
                  p = self.addPlot()
                  self.plots.append(p)
                  if titles != [] or len(titles) == 1:
                      p.setLabel('left', self.titles[i+j+1])
                  p.setDownsampling(mode='peak')
                  p.setClipToView(True)
                  pp = p.plot(pen=(155, 255, 50))
                  pp1 = p.plot(pen=(55, 130, 255))
                  self.curves.append((pp, pp1))
              self.nextRow()
  
          # Timer to redraw plots
          timer = QtCore.QTimer(self)
          self.connect(timer, QtCore.SIGNAL('timeout()'),self.update_plots)
          timer.start(100)
  
      def set_titles(self, titles):
          for i, p in enumerate(self.plots):
              p.setLabel('left', titles[i])
  
      def update_plots(self):
          np.random.seed()
          data = np.random.random((30,))
          dataD = np.random.random((30,))
          for curve in self.curves:
              curve[0].setData(data)
              curve[1].setData(dataD)
  
  
  if __name__ == '__main__':
      app = QtGui.QApplication(sys.argv)
      gui = GraphWindow(2,3,[])
      gui.show()
      app.exec_()
  </code></pre>
  
  <p>The full app is meant to be a window with multiple tabs, each one with a GraphWindow in which each graph uses a Thread for plotting different data. </p>
  
  <p>What am I missing? Why my threaded version does not represent a performance improvement?</p>