(source)
| 1016 | # Each of these examples used to take about an hour. |
| 1017 | # Now they take a fraction of a second. |
| 1018 | def check(source): |
| 1019 | parser = html.parser.HTMLParser() |
| 1020 | parser.feed(source) |
| 1021 | parser.close() |
| 1022 | n = 120_000 |
| 1023 | check("<a " * n) |
| 1024 | check("<a a=" * n) |