Skip to content

Commit 6794be4

Browse files
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.
1 parent e73c74c commit 6794be4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Lib/test/test_bytes.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,8 @@ def test_join(self):
655655
seq = [b"abc"] * 100000
656656
expected = b"abc" + b".:abc" * 99999
657657
self.assertEqual(dot_join(seq), expected)
658+
seq = [bytearray(b"abc")] * 100000
659+
self.assertEqual(dot_join(seq), expected)
658660
# Stress test with empty separator
659661
seq = [b"abc"] * 100000
660662
expected = b"abc" * 100000

0 commit comments

Comments
 (0)