Commit 903913b
gh-157509: Speed up reading mbox, MMDF and Babyl mailboxes
Track line offsets in _generate_toc() with len(line) instead of calling
tell(), which is a system call, for every line. Also compute the MMDF
and Babyl separator bytes once instead of per line.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent c674116 commit 903913b
2 files changed
Lines changed: 18 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
| 925 | + | |
925 | 926 | | |
926 | | - | |
| 927 | + | |
927 | 928 | | |
| 929 | + | |
928 | 930 | | |
929 | 931 | | |
930 | 932 | | |
| |||
972 | 974 | | |
973 | 975 | | |
974 | 976 | | |
| 977 | + | |
975 | 978 | | |
976 | 979 | | |
977 | 980 | | |
978 | | - | |
979 | | - | |
| 981 | + | |
| 982 | + | |
980 | 983 | | |
981 | 984 | | |
982 | 985 | | |
983 | 986 | | |
984 | | - | |
985 | | - | |
| 987 | + | |
| 988 | + | |
986 | 989 | | |
987 | 990 | | |
988 | 991 | | |
| |||
1418 | 1421 | | |
1419 | 1422 | | |
1420 | 1423 | | |
| 1424 | + | |
| 1425 | + | |
1421 | 1426 | | |
1422 | 1427 | | |
1423 | 1428 | | |
1424 | | - | |
1425 | | - | |
| 1429 | + | |
| 1430 | + | |
1426 | 1431 | | |
1427 | 1432 | | |
1428 | 1433 | | |
| 1434 | + | |
| 1435 | + | |
1429 | 1436 | | |
1430 | | - | |
| 1437 | + | |
1431 | 1438 | | |
1432 | 1439 | | |
1433 | | - | |
| 1440 | + | |
1434 | 1441 | | |
1435 | 1442 | | |
1436 | 1443 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments