Commit f4a8de5
committed
gh-129005: Align FileIO.readall allocation
Both now use a pre-allocated buffer of length `bufsize`, fill it using
a readinto, and have matching "expand buffer" logic.
On my machine this takes:
`./python -m test -M8g -uall test_largefile -m test_large_read -v`
from ~3.7 seconds to ~3.3 seconds1 parent 41ad2bb commit f4a8de5
1 file changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1674 | 1674 | | |
1675 | 1675 | | |
1676 | 1676 | | |
1677 | | - | |
| 1677 | + | |
| 1678 | + | |
1678 | 1679 | | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
1682 | 1691 | | |
1683 | 1692 | | |
1684 | | - | |
| 1693 | + | |
1685 | 1694 | | |
1686 | | - | |
| 1695 | + | |
1687 | 1696 | | |
1688 | 1697 | | |
1689 | | - | |
| 1698 | + | |
1690 | 1699 | | |
1691 | | - | |
| 1700 | + | |
1692 | 1701 | | |
| 1702 | + | |
1693 | 1703 | | |
1694 | 1704 | | |
1695 | 1705 | | |
| |||
0 commit comments