Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
gh-159191: Stress test bytes.join() with non-bytes items
The existing stress tests now only take the fast path. test_bytes is
part of the PGO training set, so the general path was barely trained,
and PGO builds stopped inlining PyBuffer_Release() there: joining a
list that is half bytearrays became about 14% slower than on main.
With this test it is back to main's speed.
  • Loading branch information
christianaurichzm committed Oct 12, 2026
commit 6794be4952ab29969778bbcdba1c0df7a50aaf3f
2 changes: 2 additions & 0 deletions Lib/test/test_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,8 @@ def test_join(self):
seq = [b"abc"] * 100000
expected = b"abc" + b".:abc" * 99999
self.assertEqual(dot_join(seq), expected)
seq = [bytearray(b"abc")] * 100000
self.assertEqual(dot_join(seq), expected)
# Stress test with empty separator
seq = [b"abc"] * 100000
expected = b"abc" * 100000
Expand Down
Loading