René's URL Explorer Experiment


Title: Add io_whole_file benchmark and an opt-in io group by jayzuccarelli · Pull Request #498 · python/pyperformance · GitHub

Open Graph Title: Add io_whole_file benchmark and an opt-in io group by jayzuccarelli · Pull Request #498 · python/pyperformance

X Title: Add io_whole_file benchmark and an opt-in io group by jayzuccarelli · Pull Request #498 · python/pyperformance

Description: First of three PRs for #399, one benchmark each as suggested there. This one adds the shared piece (an io group that is not part of default) together with the first benchmark that uses it. What it measures io_whole_file reads and writes a whole file in a single call, which is the pattern gh-120754 optimized: Each result measures a single API: read_bytes_{4k,1m}: open(path, "rb").read() write_bytes_{4k,1m}: open(path, "wb").write(data) read_text_1m / write_text_1m: Path.read_text() / Path.write_text(), utf-8, ASCII content read_bytes_{4k,1m}_uncached: open(path, "rb").read() with the file's pages dropped from the page cache first Path.read_bytes() / write_bytes() are thin wrappers over the same open() calls, so they are not measured separately. 8 results on Linux (6 where os.posix_fadvise is missing). 4 KiB is where per-call overhead and the number of system calls dominate; 1 MiB is where buffer allocation and copying dominate. I had an 8 MiB size too, but it scaled linearly from 1 MiB and sits closer to dirty page throttling, so I dropped it to keep the result count small. Apart from the uncached reads below, everything runs in a fresh temp dir with a warm page cache and no fsync, so it measures Python's I/O stack and syscall overhead rather than the disk. Writes always create a new file (unlinked outside the timed region): truncating and rewriting an existing file on ext4 triggers writeback on close (auto_da_alloc), which made a 16 MiB rewrite take ~490 ms +- 220 ms instead of ~30 ms. The run records io.DEFAULT_BUFFER_SIZE in the metadata. Uncached reads: read_bytes_{4k,1m}_uncached time the same open(path, "rb").read() with the file's pages dropped from the page cache before each read (os.posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED), outside the timed region; the file is fsync'ed once in setup since DONTNEED only drops clean pages, no root needed). fincore shows 0 resident pages after every drop. On a SATA SSD (ext4, 3.14) 4 KiB goes from ~17 us cached to ~204 us uncached and 1 MiB from ~148 us to ~3.4 ms. They mostly track the storage device, so they are noisier and named apart from the cached results. They are skipped where os.posix_fadvise is missing (macOS, Windows; macOS F_NOCACHE doesn't evict already-cached pages). Writes stay cached only, since an uncached write needs an fsync in the timed region, which measures the device's flush path rather than Python. Large files are left for a follow-up. Setup allocates and frees one 8 MiB block before anything is measured. On glibc that raises malloc's dynamic mmap/trim thresholds above the 1 MiB working set; without it read_text_1m (which frees two 1 MiB blocks per call) sat right at the trim threshold and, depending on heap history, flipped between ~430 us and ~1.3 ms on the same interpreter because the heap top was handed back to the kernel and faulted in again every call. Why opt-in Per the issue, I/O benchmarks shouldn't run by default. The benchmark is tagged io, [group io] picks it up through the tag, and [group default] excludes it by name (a -io group exclusion is silently ignored by the manifest parser, so it has to name the benchmark). pyperformance list is unchanged at 100 benchmarks; -b io selects it. Sample timings (pyperformance run -b io_whole_file --fast, one untuned Linux box, ext4 /tmp) result 3.13.13 3.14.4 io_whole_file_read_bytes_4k 15.6 us 13.8 us io_whole_file_write_bytes_4k 34.0 us 34.2 us io_whole_file_read_bytes_1m 153 us 148 us io_whole_file_write_bytes_1m 912 us 916 us io_whole_file_read_text_1m 437 us 501 us io_whole_file_write_text_1m 1.15 ms 1.12 ms How to run python -m pyperformance run -b io python -m pyperformance run -b io_whole_file Tests python -m pyperformance.tests passes (it runs -b all, so the io benchmarks execute there too) pyperformance list unchanged at 100, list -b io is just io_whole_file flake8 with the tox config is clean on the new file uncached skip path checked with os.posix_fadvise removed (6 cached results, no crash) No version bump: 1.14.0 is already tagged, so the changelog line goes under a new 1.15.0 heading. Happy to bump __version__ too if you want that in the same PR, as #447 did. Part of #399. AI disclosure: I used Claude Code to write the benchmark and docs; I reviewed the code and ran it.

Open Graph Description: First of three PRs for #399, one benchmark each as suggested there. This one adds the shared piece (an io group that is not part of default) together with the first benchmark that uses it. What it ...

X Description: First of three PRs for #399, one benchmark each as suggested there. This one adds the shared piece (an io group that is not part of default) together with the first benchmark that uses it. What it ...

Opengraph URL: https://github.com/python/pyperformance/pull/498

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:43dc83a6-db2c-7081-a8c2-09b5cf60e562
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCFDC:154D88:2AA2CFA:368BE52:6B01EC5C
html-safe-nonceeaebfc7300bde1a8aa365ab589d65ce1b83af0d8a8e4c4cd244289e183df8a1a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkRDOjE1NEQ4ODoyQUEyQ0ZBOjM2OEJFNTI6NkIwMUVDNUMiLCJ2aXNpdG9yX2lkIjoiNjk0Njc4NTI2NDMyNDk2MzQyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacaa183fcf5c15a7343e81c1dc7989b4b06f6075c1556f530c2df93362cb239672
hovercard-subject-tagpull_request:5033390959
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/pyperformance/pull/498/files
twitter:imagehttps://avatars.githubusercontent.com/u/11176606?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/11176606?s=400&v=4
og:image:altFirst of three PRs for #399, one benchmark each as suggested there. This one adds the shared piece (an io group that is not part of default) together with the first benchmark that uses it. What it ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/pyperformance git https://github.com/python/pyperformance.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id65949828
octolytics-dimension-repository_nwopython/pyperformance
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id65949828
octolytics-dimension-repository_network_root_nwopython/pyperformance
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/pyperformance/pull/498/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fpyperformance%2Fpull%2F498%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fpyperformance%2Fpull%2F498%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fpyperformance
Reloadhttps://github.com/python/pyperformance/pull/498/files
Reloadhttps://github.com/python/pyperformance/pull/498/files
Reloadhttps://github.com/python/pyperformance/pull/498/files
pythonhttps://github.com/python
pyperformancehttps://github.com/python/pyperformance
Codehttps://github.com/python/pyperformance
Issues53 (53)https://github.com/python/pyperformance/issues
Pull requests34 (34)https://github.com/python/pyperformance/pulls
Actionshttps://github.com/python/pyperformance/actions
Projectshttps://github.com/python/pyperformance/projects
Security and qualityhttps://github.com/python/pyperformance/security
Insightshttps://github.com/python/pyperformance/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fpyperformance%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fpyperformance%2Fissues%2Fnew%2Fchoose
jayzuccarellihttps://github.com/jayzuccarelli
python:mainhttps://github.com/python/pyperformance/tree/main
jayzuccarelli:io-whole-filehttps://github.com/jayzuccarelli/pyperformance/tree/io-whole-file
Conversation 11 https://github.com/python/pyperformance/pull/498
Commits 4 https://github.com/python/pyperformance/pull/498/commits
Checks 0 https://github.com/python/pyperformance/pull/498/checks
Files changed https://github.com/python/pyperformance/pull/498/files
Please reload this pagehttps://github.com/python/pyperformance/pull/498/files
Add io_whole_file benchmark and an opt-in io group https://github.com/python/pyperformance/pull/498/files#top
Show all changes 4 commits https://github.com/python/pyperformance/pull/498/files
74063f7 Add io_whole_file benchmark and an opt-in io group jayzuccarelli Oct 27, 2026 https://github.com/python/pyperformance/pull/498/commits/74063f79c7bb242c2d430798a8682f612415f435
488e9a2 io_whole_file: measure one API per result jayzuccarelli Oct 28, 2026 https://github.com/python/pyperformance/pull/498/commits/488e9a24cdfb3aed77a929ab4fb0330003cd0408
827a7c8 io_whole_file: measure uncached reads jayzuccarelli Oct 31, 2026 https://github.com/python/pyperformance/pull/498/commits/827a7c82a3cb02f77060f77160eb4ad6ca07c1bb
6e672c7 Merge remote-tracking branch 'upstream/main' into io-whole-file jayzuccarelli Nov 9, 2026 https://github.com/python/pyperformance/pull/498/commits/6e672c77ad8b40a7b7092614d3e0514c0168263b
Clear filters https://github.com/python/pyperformance/pull/498/files
Please reload this pagehttps://github.com/python/pyperformance/pull/498/files
Please reload this pagehttps://github.com/python/pyperformance/pull/498/files
benchmarks.rst https://github.com/python/pyperformance/pull/498/files#diff-06f408aca9c0caf57b15169bc2f749ed556bcf460a6966a74e61dd6304aa5d2a
changelog.rst https://github.com/python/pyperformance/pull/498/files#diff-cd05d972a76959467eae3b3513b758279bad7f44b589c882a83b1c93214e7477
MANIFEST https://github.com/python/pyperformance/pull/498/files#diff-2dc2836aea524883ea247e75c5a3cf1e2bb6840e6a8c9d0c24f235a666d7712b
pyproject.toml https://github.com/python/pyperformance/pull/498/files#diff-976e57c8f64dd249735ef80264033c47a798641a8659b069cd1143cdb08e6ccf
run_benchmark.py https://github.com/python/pyperformance/pull/498/files#diff-963c161c2dd1090e69cf3587a15274228b2f9a593770a68e2ba55c4807f9aa9f
doc/benchmarks.rsthttps://github.com/python/pyperformance/pull/498/files#diff-06f408aca9c0caf57b15169bc2f749ed556bcf460a6966a74e61dd6304aa5d2a
View file https://github.com/python/pyperformance/blob/6e672c77ad8b40a7b7092614d3e0514c0168263b/doc/benchmarks.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/pyperformance/pull/498/{{ revealButtonHref }}
https://github.com/python/pyperformance/pull/498/files#diff-06f408aca9c0caf57b15169bc2f749ed556bcf460a6966a74e61dd6304aa5d2a
https://github.com/python/pyperformance/pull/498/files#diff-06f408aca9c0caf57b15169bc2f749ed556bcf460a6966a74e61dd6304aa5d2a
https://github.com/python/pyperformance/pull/498/files#diff-06f408aca9c0caf57b15169bc2f749ed556bcf460a6966a74e61dd6304aa5d2a
https://github.com/python/pyperformance/pull/498/files#diff-06f408aca9c0caf57b15169bc2f749ed556bcf460a6966a74e61dd6304aa5d2a
doc/changelog.rsthttps://github.com/python/pyperformance/pull/498/files#diff-cd05d972a76959467eae3b3513b758279bad7f44b589c882a83b1c93214e7477
View file https://github.com/python/pyperformance/blob/6e672c77ad8b40a7b7092614d3e0514c0168263b/doc/changelog.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/pyperformance/pull/498/{{ revealButtonHref }}
https://github.com/python/pyperformance/pull/498/files#diff-cd05d972a76959467eae3b3513b758279bad7f44b589c882a83b1c93214e7477
https://github.com/python/pyperformance/pull/498/files#diff-cd05d972a76959467eae3b3513b758279bad7f44b589c882a83b1c93214e7477
pyperformance/data-files/benchmarks/MANIFESThttps://github.com/python/pyperformance/pull/498/files#diff-2dc2836aea524883ea247e75c5a3cf1e2bb6840e6a8c9d0c24f235a666d7712b
View file https://github.com/python/pyperformance/blob/6e672c77ad8b40a7b7092614d3e0514c0168263b/pyperformance/data-files/benchmarks/MANIFEST
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/pyperformance/pull/498/{{ revealButtonHref }}
https://github.com/python/pyperformance/pull/498/files#diff-2dc2836aea524883ea247e75c5a3cf1e2bb6840e6a8c9d0c24f235a666d7712b
https://github.com/python/pyperformance/pull/498/files#diff-2dc2836aea524883ea247e75c5a3cf1e2bb6840e6a8c9d0c24f235a666d7712b
https://github.com/python/pyperformance/pull/498/files#diff-2dc2836aea524883ea247e75c5a3cf1e2bb6840e6a8c9d0c24f235a666d7712b
pyperformance/data-files/benchmarks/bm_io_whole_file/pyproject.tomlhttps://github.com/python/pyperformance/pull/498/files#diff-976e57c8f64dd249735ef80264033c47a798641a8659b069cd1143cdb08e6ccf
View file https://github.com/python/pyperformance/blob/6e672c77ad8b40a7b7092614d3e0514c0168263b/pyperformance/data-files/benchmarks/bm_io_whole_file/pyproject.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/pyperformance/pull/498/{{ revealButtonHref }}
pyperformance/data-files/benchmarks/bm_io_whole_file/run_benchmark.pyhttps://github.com/python/pyperformance/pull/498/files#diff-963c161c2dd1090e69cf3587a15274228b2f9a593770a68e2ba55c4807f9aa9f
View file https://github.com/python/pyperformance/blob/6e672c77ad8b40a7b7092614d3e0514c0168263b/pyperformance/data-files/benchmarks/bm_io_whole_file/run_benchmark.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/pyperformance/pull/498/{{ revealButtonHref }}
cmaloneyhttps://github.com/cmaloney
Nov 9, 2026https://github.com/python/pyperformance/pull/498/files#r4508909516
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://www.kernel.org/doc/html/latest/admin-guide/sysctl/vm.html#drop-cacheshttps://www.kernel.org/doc/html/latest/admin-guide/sysctl/vm.html#drop-caches
PEP 11https://peps.python.org/pep-0011/
Please reload this pagehttps://github.com/python/pyperformance/pull/498/files
jayzuccarellihttps://github.com/jayzuccarelli
Nov 9, 2026https://github.com/python/pyperformance/pull/498/files#r4512734682
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/pyperformance/pull/498/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.