Skip to content

Commit 13cdc30

Browse files
Merge branch 'main' into pypy
2 parents 7149f8c + c26b5f9 commit 13cdc30

16 files changed

Lines changed: 596 additions & 36 deletions

File tree

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v6
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717
with:
1818
persist-credentials: false
19-
- uses: j178/prek-action@v1
19+
- uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2

.github/workflows/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ jobs:
5252
python: "3.14"
5353
experimental: false
5454
steps:
55-
- uses: actions/checkout@v6
55+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
56+
with:
57+
persist-credentials: false
5658
- name: Set up Python ${{ matrix.python }}
57-
uses: actions/setup-python@v6
59+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5860
if: "!endsWith(matrix.python, '-dev')"
5961
with:
6062
python-version: ${{ matrix.python }}
6163
- name: Set up Python ${{ matrix.python }} using deadsnakes
62-
uses: deadsnakes/action@v3.2.0
64+
uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0
6365
if: "endsWith(matrix.python, '-dev')"
6466
with:
6567
python-version: ${{ matrix.python }}

.github/workflows/mypy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ jobs:
1414
name: Check code with mypy
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v6
18-
- uses: actions/setup-python@v6
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
20+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1921
with:
2022
cache: "pip"
2123
cache-dependency-path: "pyproject.toml"

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
id-token: write
1616

1717
steps:
18-
- uses: actions/checkout@v6
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
1921
- name: Set up Python
20-
uses: actions/setup-python@v6
22+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2123
with:
2224
python-version: '3.x'
23-
cache: pip
24-
cache-dependency-path: pyproject.toml
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade build
@@ -30,4 +30,4 @@ jobs:
3030
python -m build
3131
- name: Publish distribution 📦 to PyPI
3232
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
33-
uses: pypa/gh-action-pypi-publish@release/v1
33+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

.pre-commit-config.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exclude: ^pyperformance/data-files/
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.13.1
4+
rev: v0.15.11
55
hooks:
66
- id: ruff-check
77
name: Run Ruff (lint)
@@ -10,12 +10,33 @@ repos:
1010
name: Run Ruff (format)
1111
args: [--exit-non-zero-on-fix]
1212

13+
- repo: https://github.com/python-jsonschema/check-jsonschema
14+
rev: 0.37.1
15+
hooks:
16+
- id: check-dependabot
17+
- id: check-github-workflows
18+
19+
- repo: https://github.com/rhysd/actionlint
20+
rev: v1.7.12
21+
hooks:
22+
- id: actionlint
23+
24+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
25+
rev: v1.23.1
26+
hooks:
27+
- id: zizmor
28+
1329
- repo: https://github.com/tox-dev/pyproject-fmt
14-
rev: v2.6.0
30+
rev: v2.21.1
1531
hooks:
1632
- id: pyproject-fmt
1733

1834
- repo: https://github.com/abravalheri/validate-pyproject
19-
rev: v0.24.1
35+
rev: v0.25
2036
hooks:
2137
- id: validate-pyproject
38+
39+
- repo: meta
40+
hooks:
41+
- id: check-hooks-apply
42+
- id: check-useless-excludes

doc/benchmark.conf.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ pgo = True
5151
# PYTHON_JIT=0 can be used to disable the micro-op interpreter at runtime.
5252
jit = no
5353

54+
# Tail-calling interpreter?
55+
tail_call_interp = False
56+
5457
# The space-separated list of libraries that are package-only,
5558
# i.e., locally installed but not on header and library paths.
5659
# For each such library, determine the install path and add an

doc/benchmarks.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@ Available benchmarks:
102102
See the `base64 module <https://docs.python.org/dev/library/base64.html>`_.
103103

104104

105+
btree
106+
-----
107+
108+
Benchmark a pure-Python implementation of a B-tree data structure. The tree
109+
is created with a relatively large number of nodes (default is 200,000). This
110+
attempts to simulate an application that operates on a large number of objects
111+
in memory (at least, large compared to other benchmarks currently in this
112+
suite). There are two variations of this benchmark: `btree` records the time to
113+
create the B-tree, run `gc.collect()` and then do some operations on it; the
114+
`btree_gc_only` variant records only the time to run `gc.collect()` and it
115+
skips the operations after creation.
116+
117+
Note that this benchmark does not create any reference cycles that the garbage
118+
collector will need to break to free memory.
119+
120+
105121
chameleon
106122
---------
107123

pyperformance/compile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ def compile(self):
295295
config_args.append("--with-lto")
296296
if self.conf.jit:
297297
config_args.append(f"--enable-experimental-jit={self.conf.jit}")
298+
if self.conf.tail_call_interp:
299+
config_args.append("--with-tail-call-interp")
298300
if self.conf.pkg_only:
299301
config_args.extend(self.get_package_only_flags())
300302
if self.conf.debug:
@@ -830,6 +832,7 @@ def getint(section, key, default=None):
830832
conf.lto = getboolean("compile", "lto", True)
831833
conf.pgo = getboolean("compile", "pgo", True)
832834
conf.jit = getstr("compile", "jit", "")
835+
conf.tail_call_interp = getboolean("compile", "tail_call_interp", False)
833836
conf.install = getboolean("compile", "install", True)
834837
conf.pkg_only = getstr("compile", "pkg_only", "").split()
835838
try:

pyperformance/data-files/benchmarks/MANIFEST

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ asyncio_tcp_ssl <local:asyncio_tcp>
2626
asyncio_websockets <local>
2727
base64 <local>
2828
bpe_tokeniser <local>
29+
btree <local>
30+
btree_gc_only <local:btree>
2931
concurrent_imap <local>
3032
coroutines <local>
3133
coverage <local>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.pyperformance]
2+
name = "btree_gc"
3+
extra_opts = ["all"]

0 commit comments

Comments
 (0)