Skip to content

Commit edd2b9b

Browse files
committed
Add the 'bm_btree' benchmark.
1 parent 15a82c9 commit edd2b9b

File tree

6 files changed

+507
-0
lines changed

6 files changed

+507
-0
lines changed

Diff for: doc/benchmarks.rst

+16
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,22 @@ These benchmarks also have an "eager" flavor that uses asyncio eager task factor
7676
if available.
7777

7878

79+
btree
80+
-----
81+
82+
Benchmark a pure-Python implementation of a B-tree data structure. The tree
83+
is created with a relatively large number of nodes (default is 200,000). This
84+
attempts to simulate an application that operates on a large number of objects
85+
in memory (at least, large compared to other benchmarks currently in this
86+
suite). There are two variations of this benchmark: `btree` records the time to
87+
create the B-tree, run `gc.collect()` and then do some operations on it; the
88+
`btree_gc_only` variant records only the time to run `gc.collect()` and it
89+
skips the operations after creation.
90+
91+
Note that this benchmark does not create any reference cycles that the garbage
92+
collector will need to break to free memory.
93+
94+
7995
chameleon
8096
---------
8197

Diff for: pyperformance/data-files/benchmarks/MANIFEST

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ asyncio_tcp <local>
2525
asyncio_tcp_ssl <local:asyncio_tcp>
2626
asyncio_websockets <local>
2727
bpe_tokeniser <local>
28+
btree <local>
29+
btree_gc_only <local:btree>
2830
concurrent_imap <local>
2931
coroutines <local>
3032
coverage <local>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.pyperformance]
2+
name = "btree_gc"
3+
extra_opts = ["all"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.pyperformance]
2+
name = "btree_gc"
3+
extra_opts = ["--gc-only"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[project]
2+
name = "pyperformance_bm_btree"
3+
requires-python = ">=3.8"
4+
dependencies = ["pyperf"]
5+
urls = {repository = "https://github.com/python/pyperformance"}
6+
dynamic = ["version"]
7+
8+
[tool.pyperformance]
9+
name = "btree"

0 commit comments

Comments
 (0)