Permalink
Browse files

a pretty good release

  • Loading branch information...
1 parent 0fcfdd4 commit 113b689bb0d0b8ad76223843f6f092c4709121a9 @ghtdak committed Mar 10, 2008
Showing with 390 additions and 26 deletions.
  1. +13 −4 README
  2. +2 −22 qt4reactor.py
  3. +375 −0 trial.diff
View
17 README
@@ -31,13 +31,22 @@ shouldn't be an issue.
Included in this directory is a diff of trial's stdout between the
default reactor and the Qt4 reactor. The large time differences are
due to hangage in some of the I/O tests unrelated to the performance
-of the reactor itself which is very good (to be quantified... I think
-its very good :-)
+of the reactor itself which is seems very good.
+
+The diff is for the full test
+
+# trial --rterrors --unclean-warnings --reactor=qt4 twisted 2>&1 | tee /tmp/qt4trial.trial
+
+# trial --rterrors --unclean-warnings twisted 2>&1 | tee /tmp/selecttrial.trial
-# trial twisted $> /tmp/select.trial
-# trial --unclean-warnings --reactor=qt4 twisted &> /tmp/qt4.trial
# diff /tmp/select.trial /tmp/qt4.trial > trial.diff
+I don't have it here, but for a subset of the tests = twisted.test,
+the difference was a few percent. Something about the full suite
+slowing things down. I'm running profiles now but the tests I ran
+indicate a very zippy reactor... these differences are due to it being
+incorrect and causing hanging / spinning.
+
-glenn
--
View
@@ -61,7 +61,7 @@ def shutdown(self):
def read(self, sock):
w = self.watcher
- #self.setEnabled(False)
+ #self.setEnabled(False) # ??? do I need this?
def _read():
why = None
try:
@@ -99,32 +99,19 @@ def __init__(self):
QEventLoop.__init__(self)
def exec_(self):
- #print 'entering exec_'
QEventLoop.exec_(self)
-class signalCatcher(QObject):
- def __init__(self):
- QObject.__init__(self)
-
- def callLaterSignal(self):
- self.emit(SIGNAL("twistedEvent"),'c')
-
class QTReactor(PosixReactorBase):
"""
Qt based reactor.
"""
implements(IReactorFDSet)
- # Reference to a DelayedCall for self.crash() when the reactor is
- # entered through .iterate()
- _crashCall = None
-
_timer = None
def __init__(self):
self._reads = {}
self._writes = {}
- self._readWriteQ=[]
self._timer=QTimer()
self._timer.setSingleShot(True)
if QCoreApplication.startingUp():
@@ -134,7 +121,7 @@ def __init__(self):
self.qApp = QCoreApplication.instance()
self._ownApp=False
self._blockApp = None
- self._signalCatcher = signalCatcher()
+ self._readWriteQ=[]
""" some debugging instrumentation """
self._doSomethingCount=0
@@ -179,17 +166,14 @@ def getWriters(self):
def callLater(self,howlong, *args, **kargs):
rval = super(QTReactor,self).callLater(howlong, *args, **kargs)
self.qApp.emit(SIGNAL("twistedEvent"),'c')
- #self._signalCatcher.callLaterSignal()
return rval
def crash(self):
super(QTReactor,self).crash()
def cleanup(self):
- #print 'cleanup'
self.iterate(0.1) # cleanup pending events?
self.running=False
- #self.iterate() # cleanup pending events?
self.qApp.emit(SIGNAL("twistedEvent"),'shutdown')
def toxic_Reiterate(self,delay=0.0):
@@ -214,10 +198,6 @@ def addReadWrite(self,t):
def runReturn(self, installSignalHandlers=True):
QObject.connect(self.qApp,SIGNAL("twistedEvent"),
self.reactorInvocation)
-#===============================================================================
-# QObject.connect(self._signalCatcher,SIGNAL("twistedEvent"),
-# self.reactorInvocation)
-#===============================================================================
QObject.connect(self._timer, SIGNAL("timeout()"),
self.reactorInvoke)
self.startRunning(installSignalHandlers=installSignalHandlers)
Oops, something went wrong.

0 comments on commit 113b689

Please sign in to comment.