##// END OF EJS Templates
changegroup: store old heads as a set...
changegroup: store old heads as a set Previously, the "oldheads" variable was a list. On a repository at Mozilla with 46,492 heads, profiling revealed that list membership testing was dominating execution time of applying small changegroups. This patch converts the list of old heads to a set. This makes membership testing significantly faster. On the aforementioned repository with 46,492 heads: $ hg unbundle <file with 1 changeset> before: 18.535s wall after: 1.303s Consumers of this variable only check for truthiness (`if oldheads`), length (`len(oldheads)`), and (most importantly) item membership (`h not in oldheads` - which occurs twice). So, the change to a set should be safe and suitable for stable. The practical effect of this change is that changegroup application and related operations (like `hg push`) no longer exhibit an O(n^2) CPU explosion as the number of heads grows.

File last commit:

r28793:d30fdd6d default
r31587:ed5b2587 4.1.2 stable
Show More
.editorconfig
13 lines | 220 B | text/x-ini | IniLexer
# See http://EditorConfig.org for the specification
root = true
[*.py]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
[*.{c,h}]
indent_size = 8
indent_style = tab
trim_trailing_whitespace = true