From b5661c6f5eeacf433b56b8205af89420c2a9cdfd Mon Sep 17 00:00:00 2001 From: Bryan Mayland Date: Fri, 28 Jun 2013 10:55:34 -0400 Subject: [PATCH] Remove unused comm logQueue. 18% performance increase (12% vs baseline) --- octoprint/util/comm.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/octoprint/util/comm.py b/octoprint/util/comm.py index 20d306ec..5f8b37fd 100644 --- a/octoprint/util/comm.py +++ b/octoprint/util/comm.py @@ -394,7 +394,6 @@ class MachineCom(object): self._targetTemp = 0 self._bedTargetTemp = 0 self._commandQueue = queue.Queue() - self._logQueue = queue.Queue(256) self._currentZ = None self._heatupWaitStartTime = 0 self._heatupWaitTimeLost = 0.0 @@ -542,14 +541,6 @@ class MachineCom(object): def getBedTemp(self): return self._bedTemp - def getLog(self): - ret = [] - while not self._logQueue.empty(): - ret.append(self._logQueue.get()) - for line in ret: - self._logQueue.put(line, False) - return ret - def _monitor(self): import cProfile cProfile.runctx('self._actMonitor()',globals(),locals(),'/tmp/profile.log') @@ -863,15 +854,6 @@ class MachineCom(object): def _log(self, message): self._callback.mcLog(message) self._serialLogger.debug(message) - try: - self._logQueue.put(message, False) - except: - #If the log queue is full, remove the first message and append the new message again - self._logQueue.get() - try: - self._logQueue.put(message, False) - except: - pass def _readline(self): if self._serial == None: