cpython/Misc
Cody Maloney 35d8ac7cd7
GH-120754: Disable buffering in Path.read_bytes (#122111)
`Path.read_bytes()` is used to read a whole file. buffering /
BufferedIO is focused around making small, possibly interleaved,
read/write efficient which doesn't add value in this case.

On my Mac, running the benchmark:

```python
import pyperf
from pathlib import Path

def read_all(all_paths):
    for p in all_paths:
        p.read_bytes()

def read_file(path_obj):
    path_obj.read_bytes()

all_rst = list(Path("Doc").glob("**/*.rst"))
all_py = list(Path(".").glob("**/*.py"))
assert all_rst, "Should have found rst files"
assert all_py, "Should have found python source files"

runner = pyperf.Runner()
runner.bench_func("read_file_small", read_file, Path("Doc/howto/clinic.rst"))
runner.bench_func("read_file_large", read_file, Path("Doc/c-api/typeobj.rst"))
```

before:
```python
.....................
read_file_small: Mean +- std dev: 6.80 us +- 0.07 us
.....................
read_file_large: Mean +- std dev: 10.8 us +- 0.2 us
````

after:
```python
.....................
read_file_small: Mean +- std dev: 5.67 us +- 0.05 us
.....................
read_file_large: Mean +- std dev: 9.77 us +- 0.52 us
```
2024-08-16 13:52:41 -07:00
..
NEWS.d GH-120754: Disable buffering in Path.read_bytes (#122111) 2024-08-16 13:52:41 -07:00
rhel7
ACKS gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047) 2024-08-07 16:07:26 +01:00
HISTORY NEWS: Fix Sphinx warnings and increase threshold for new news nits (#121482) 2024-07-08 14:30:05 -06:00
Porting
README
README.AIX
README.coverity
README.valgrind
SpecialBuilds.txt
coverity_model.c
externals.spdx.json gh-116145: Updated bundled Tcl/Tk on Windows to 8.6.14 (GH-117030) 2024-05-31 13:07:19 +01:00
indent.pro
platform_triplet.c gh-114099: Modify preprocessor symbol usage to support older macOS SDKs (GH-118073) 2024-04-19 14:56:33 -04:00
python-config.in bpo-45101: Add consistency in usage message IO between 2 versions of python-config (GH-28162) 2024-02-26 22:04:44 +02:00
python-config.sh.in gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764) 2024-08-09 00:00:55 +02:00
python-embed.pc.in
python.man gh-121101: Document -Wall option (an alias for -Walways) (#121102) 2024-06-29 12:10:13 +05:30
python.pc.in gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764) 2024-08-09 00:00:55 +02:00
sbom.spdx.json gh-99108: Add HACL* Blake2 implementation to hashlib (GH-119316) 2024-08-13 21:42:19 +00:00
stable_abi.toml gh-105201: Add PyIter_NextItem() (#122331) 2024-08-08 00:47:15 +02:00
svnmap.txt
valgrind-python.supp gh-121096: Ignore dlopen() leaks in Valgrind suppression file (#121097) 2024-06-28 13:10:11 +02:00
vgrindefs

README

Python Misc subdirectory
========================

This directory contains files that wouldn't fit in elsewhere.  Some
documents are only of historic importance.

Files found here
----------------

ACKS                    Acknowledgements
HISTORY                 News from previous releases -- oldest last
indent.pro              GNU indent profile approximating my C style
NEWS                    News for this release (for some meaning of "this")
Porting                 Mini-FAQ on porting to new platforms
python-config.in        Python script template for python-config
python.man              UNIX man page for the python interpreter
python.pc.in            Package configuration info template for pkg-config
README                  The file you're reading now
README.AIX              Information about using Python on AIX
README.coverity         Information about running Coverity's Prevent on Python
README.valgrind         Information for Valgrind users, see valgrind-python.supp
SpecialBuilds.txt       Describes extra symbols you can set for debug builds
svnmap.txt              Map of old SVN revs and branches to hg changeset ids,
                        help history-digging
valgrind-python.supp    Valgrind suppression file, see README.valgrind
vgrindefs               Python configuration for vgrind (a generic pretty printer)