Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the 'btree' benchmark. #381

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/benchmarks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ These benchmarks also have an "eager" flavor that uses asyncio eager task factor
if available.


btree
-----

Benchmark a pure-Python implementation of a B-tree data structure. The tree
is created with a relatively large number of nodes (default is 200,000). This
attempts to simulate an application that operates on a large number of objects
in memory (at least, large compared to other benchmarks currently in this
suite). There are two variations of this benchmark: `btree` records the time to
create the B-tree, run `gc.collect()` and then do some operations on it; the
`btree_gc_only` variant records only the time to run `gc.collect()` and it
skips the operations after creation.

Note that this benchmark does not create any reference cycles that the garbage
collector will need to break to free memory.


chameleon
---------

Expand Down
2 changes: 2 additions & 0 deletions pyperformance/data-files/benchmarks/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ asyncio_tcp <local>
asyncio_tcp_ssl <local:asyncio_tcp>
asyncio_websockets <local>
bpe_tokeniser <local>
btree <local>
btree_gc_only <local:btree>
concurrent_imap <local>
coroutines <local>
coverage <local>
Expand Down
3 changes: 3 additions & 0 deletions pyperformance/data-files/benchmarks/bm_btree/bm_btree.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.pyperformance]
name = "btree_gc"
extra_opts = ["all"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.pyperformance]
name = "btree_gc"
extra_opts = ["--gc-only"]
9 changes: 9 additions & 0 deletions pyperformance/data-files/benchmarks/bm_btree/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
name = "pyperformance_bm_btree"
requires-python = ">=3.8"
dependencies = ["pyperf"]
urls = {repository = "https://github.com/python/pyperformance"}
dynamic = ["version"]

[tool.pyperformance]
name = "btree"
Loading
Loading