Skip to content

Commit 2f0cea7

Browse files
committed
benchmark tests updated
1 parent 8dd7f65 commit 2f0cea7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pydatastructs/trees/tests/benchmarks/test_binary_trees.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ def f(backend):
1717
b = BST(backend=backend)
1818
for node in range(-1000,1000):
1919
b.insert(node, node)
20+
for node in range(-1000, 1000):
21+
b.search(node)
22+
for node in range(2000):
23+
b.delete(node)
2024

2125
backend_dict = {"backend": Backend.PYTHON}
2226
timer_python = timeit.Timer(functools.partial(f, **backend_dict))
@@ -25,5 +29,6 @@ def f(backend):
2529
backend_dict = {"backend": Backend.CPP}
2630
timer_cpp = timeit.Timer(functools.partial(f, **backend_dict))
2731
cpp_backend = min(timer_cpp.repeat(repeat, number))
28-
32+
print("Python time: ", python_backend)
33+
print("C++ time: ", cpp_backend)
2934
assert cpp_backend < python_backend

0 commit comments

Comments
 (0)