Compare commits

...

2 Commits

Author SHA1 Message Date
e201f67684 update test times
git-svn-id: https://bucket.mit.edu/svn/nilm/tags/nilmdb-orig-tests@11322 ddd99763-3ecb-0310-9145-efcb8ce7c51f
2012-10-22 21:50:11 +00:00
44fce1ff33 tags
git-svn-id: https://bucket.mit.edu/svn/nilm/tags/nilmdb-orig-tests@10370 ddd99763-3ecb-0310-9145-efcb8ce7c51f
2012-02-08 18:07:19 +00:00
4 changed files with 15 additions and 7 deletions

View File

@ -1,2 +1,2 @@
all: all:
nosetests nosetests nilmdb/test_interval.py

View File

@ -91,7 +91,8 @@ def test_intervalset_construct():
assert(iseta == isetc) assert(iseta == isetc)
assert(iseta != 3) assert(iseta != 3)
assert(IntervalSet(a) != IntervalSet(b)) assert(IntervalSet(a) != IntervalSet(b))
print iseta == None
assert_raises(TypeError, cmp, iseta, isetb) assert_raises(TypeError, cmp, iseta, isetb)
assert_raises(IntervalError, IntervalSet, [a, b, c]) assert_raises(IntervalError, IntervalSet, [a, b, c])
assert_raises(TypeError, IntervalSet, [1, 2]) assert_raises(TypeError, IntervalSet, [1, 2])

View File

@ -1,5 +1,5 @@
all: all:
python speed-readbinary.py python speed-readascii.py
clean: clean:
rm -f *pyc rm -f *pyc

View File

@ -43,17 +43,24 @@ def test_bigregex():
if (n % 100000 == 0): if (n % 100000 == 0):
printf("line %d = %s\n", n, str(out)) printf("line %d = %s\n", n, str(out))
def test_numpy():
out = np.genfromtxt(open('1m.raw', 'r'),
dtype = np.dtype('i2,i2,i2,i2,i2,i2'))
with Timer("numpy"):
test_numpy() # 106k/sec
with Timer("regex"): with Timer("regex"):
test_regex() # 102k/sec test_regex() # 121k/sec
with Timer("split"): with Timer("split"):
test_split() # 175k/sec test_split() # 219k/sec
with Timer("split2"): with Timer("split2"):
test_split2() # 275k/sec test_split2() # 328k/sec
with Timer("bigregex"): with Timer("bigregex"):
test_bigregex() # 110k/sec test_bigregex() # 130k/sec
# The "int" operation takes quite a while -- int(x,10) is twice as fast # The "int" operation takes quite a while -- int(x,10) is twice as fast
# Perl does about 500k/sec # Perl does about 500k/sec