From: Uwe Hermann Date: Mon, 12 Apr 2010 17:42:35 +0000 (+0200) Subject: Use psyco (if available) to improve performance. X-Git-Tag: libsigrokdecode-0.1.0~342 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=887d6cfa6a924254a9a96a3cc704e6189a53b944;p=libsigrokdecode.git Use psyco (if available) to improve performance. --- diff --git a/scripts/i2c.py b/scripts/i2c.py index f7022f5..46c3381 100644 --- a/scripts/i2c.py +++ b/scripts/i2c.py @@ -162,3 +162,10 @@ def sigrokdecode_register_i2c(): } return metadata +# Use psyco (if available) as it results in huge performance improvements. +try: + import psyco + psyco.bind(sigrokdecode_i2c) +except ImportError: + pass + diff --git a/scripts/transitioncounter.py b/scripts/transitioncounter.py index cbf8068..df7e27e 100644 --- a/scripts/transitioncounter.py +++ b/scripts/transitioncounter.py @@ -70,3 +70,10 @@ def sigrokdecode_count_transitions(inbuf): return outbuf +# Use psyco (if available) as it results in huge performance improvements. +try: + import psyco + psyco.bind(sigrokdecode_count_transitions) +except ImportError: + pass +