[Buildbot-commits] buildbot/buildbot/status builder.py,1.40,1.41

Brian Warner warner at users.sourceforge.net
Thu Nov 11 19:31:17 UTC 2004


Update of /cvsroot/buildbot/buildbot/buildbot/status
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25522/buildbot/status

Modified Files:
	builder.py 
Log Message:
* buildbot/status/builder.py (LogFile.addEntry): Merge string
chunks together, up to 10kb per chunk. This ought to cut down on
the CPU-burning overhead of large log files. Thanks to Alexander
Staubo for spotting the problem.
* buildbot/test/test_status.py (Log): tests for same


Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- builder.py	8 Nov 2004 21:19:39 -0000	1.40
+++ builder.py	11 Nov 2004 19:31:15 -0000	1.41
@@ -125,7 +125,15 @@
 
     def addEntry(self, channel, text):
         assert not self.finished
-        self.entries.append((channel, text))
+        if (self.entries
+            and channel == self.entries[-1][0]
+            and len(self.entries[-1][1]) < 10000):
+            # merge same-category chunks together, up to 10kb each, to cut
+            # down on overhead when assembling these into a single big string
+            # later.
+            self.entries[-1] = (channel, self.entries[-1][1] + text)
+        else:
+            self.entries.append((channel, text))
         for w in self.watchers:
             w.logChunk(self.step.build, self.step, self, channel, text)
         self.length += len(text)





More information about the Commits mailing list