Improved query performance test
This commit is contained in:
parent
889f51f5c5
commit
2fb515195c
@ -28,8 +28,8 @@ class PerformanceTestCase(unittest.TestCase):
|
|||||||
print(f'i: {iterable}s')
|
print(f'i: {iterable}s')
|
||||||
print(f'e: {enumerable}s')
|
print(f'e: {enumerable}s')
|
||||||
|
|
||||||
self.assertLess(default, enumerable)
|
self.assertAlmostEqual(round(default, 3), round(enumerable, 3))
|
||||||
self.assertLess(default, iterable)
|
self.assertAlmostEqual(round(default, 3), round(iterable, 3))
|
||||||
|
|
||||||
def test_where_single(self):
|
def test_where_single(self):
|
||||||
default = timeit.timeit(lambda: [x for x in list(range(0, VALUES)) if x == 50], number=COUNT)
|
default = timeit.timeit(lambda: [x for x in list(range(0, VALUES)) if x == 50], number=COUNT)
|
||||||
|
Loading…
Reference in New Issue
Block a user