Commit 5619626
authored
Improve huge_patch test (#60)
* Measure just the performance of the parser
We don't want to measure time of test data preparation because it could
be slow in some python interpreters, depending on how string
concatenation is implemented.
* Improve memory efficiency for test data preparation
Data preparation for huge_patch test could be very slow because strings
are immutable, each concatenation creates a new string and discards
the old ones.
New approach of data preparation is to concatenate large string from
smaller parts with ''.join() method. This method reduces memory usage
and enhances performance, because it minimizes the number of new string
objects created.1 parent 7691687 commit 5619626
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1426 | 1426 | | |
1427 | 1427 | | |
1428 | 1428 | | |
1429 | | - | |
1430 | | - | |
| 1429 | + | |
1431 | 1430 | | |
1432 | 1431 | | |
1433 | 1432 | | |
| |||
1439 | 1438 | | |
1440 | 1439 | | |
1441 | 1440 | | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
1445 | 1445 | | |
1446 | 1446 | | |
1447 | 1447 | | |
| |||
0 commit comments