gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] Speed up gpsfake.


From: Beat Bolli
Subject: [gpsd-dev] [PATCH] Speed up gpsfake.
Date: Thu, 17 May 2012 18:29:24 +0200

By advancing the twirly baton only each 11th line, the whole
regress-driver run is sped up by 7% when run over SSH.
---
 gpsfake |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gpsfake b/gpsfake
index cccfb9d..029de3e 100755
--- a/gpsfake
+++ b/gpsfake
@@ -31,10 +31,11 @@ class Baton:
         if os.isatty(self.stream.fileno()):
             if ch:
                 self.stream.write(ch)
-            else:
+                self.stream.flush()
+            elif self.count % 11 == 0:
                 self.stream.write("-/|\\"[self.count % 4])
                 self.stream.write("\010")
-            self.stream.flush()
+                self.stream.flush()
         self.count = self.count + 1
         return
 
-- 
1.7.10



reply via email to

[Prev in Thread] Current Thread [Next in Thread]