This is an archive of the discontinued Mercurial Phabricator instance.

mergestate: optimize unresolvedcount() a little bit
AbandonedPublic

Authored by durin42 on May 18 2020, 6:08 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

It struck me as wasteful to make this extra list copy of a generator. I was
hoping to manage to return a bool instead of an int (and thus avoid traversing
the dictionary past the first unresolved entry) but at least one caller cares
about the count and this is the easy way forward while still making me
marginally happier.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

durin42 created this revision.May 18 2020, 6:08 PM
durin42 updated this revision to Diff 21510.May 28 2020, 4:26 PM
durin42 updated this revision to Diff 21517.May 28 2020, 5:09 PM

Do you have any concret performance number of case where this is an issue?

I don't have concrete numbers, but it avoids some function calls and uses only internal details instead of part of the public API.

We can also drop it if it's objectionable, I guess.

Unless we have evidence that this is performance concerns I would rather keep the simpler (code)

durin42 abandoned this revision.Jun 11 2020, 11:29 AM