Compare commits

...

2 Commits

Author SHA1 Message Date
  Jim Paris e201f67684 update test times 8 years ago
  Jim Paris 44fce1ff33 tags 9 years ago
4 changed files with 15 additions and 7 deletions
Split View
  1. +1
    -1
      Makefile
  2. +2
    -1
      nilmdb/test_interval.py
  3. +1
    -1
      test/Makefile
  4. +11
    -4
      test/speed-readascii.py

+ 1
- 1
Makefile View File

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

+ 2
- 1
nilmdb/test_interval.py View File

@@ -91,7 +91,8 @@ def test_intervalset_construct():
assert(iseta == isetc)
assert(iseta != 3)
assert(IntervalSet(a) != IntervalSet(b))

print iseta == None
assert_raises(TypeError, cmp, iseta, isetb)
assert_raises(IntervalError, IntervalSet, [a, b, c])
assert_raises(TypeError, IntervalSet, [1, 2])


+ 1
- 1
test/Makefile View File

@@ -1,5 +1,5 @@
all:
python speed-readbinary.py
python speed-readascii.py

clean:
rm -f *pyc

+ 11
- 4
test/speed-readascii.py View File

@@ -43,17 +43,24 @@ def test_bigregex():
if (n % 100000 == 0):
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"):
test_regex() # 102k/sec
test_regex() # 121k/sec

with Timer("split"):
test_split() # 175k/sec
test_split() # 219k/sec

with Timer("split2"):
test_split2() # 275k/sec
test_split2() # 328k/sec

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
# Perl does about 500k/sec


Loading…
Cancel
Save