This is an archive of the discontinued Mercurial Phabricator instance.

[PoC] transaction: Use intbitset for implementing changes['phase']
AbandonedPublic

Authored by joerg.sonnenberger on Dec 8 2017, 7:06 PM.

Details

Reviewers
yuja
Group Reviewers
hg-reviewers
Summary

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

quark added a subscriber: quark.Dec 8 2017, 7:31 PM

Although this is definitely better for the clone case. intbitset does not seem to implement segmented bitsets so the memory usage could in theory be worse for other cases.

mercurial/localrepo.py
1283

It's still worthwhile to have set() as a fallback. So the code runs in pure python or pypy environment

yuja requested changes to this revision.Dec 9 2017, 8:18 AM
yuja added a subscriber: yuja.

Although this is definitely better for the clone case. intbitset does not seem to implement segmented bitsets so the memory usage could in theory be worse for other cases.

Perhaps. And if we need to iterate a sparse bitset, the performance would
be way worse.

This revision now requires changes to proceed.Dec 9 2017, 8:18 AM

Like I said, this is primarily a proof of concept. I'm still playing with different approaches and I don't think intbitset is a good fit for other reasons, but it worked the best from the various pre-existing implementations.

yuja retitled this revision from transaction: Use intbitset for implementing changes['phase'] to [PoC] transaction: Use intbitset for implementing changes['phase'].Dec 10 2017, 6:04 AM
yuja added a comment.Dec 10 2017, 6:08 AM

Like I said, this is primarily a proof of concept. I'm still playing with different approaches

Ah, okay. I've added [PoC] to the subject so this won't be queued by mistake.

FWIW, we generally don't move codes to C unless there is significant improvement.

Obsoleted by range based representation, which often works even better and doesn't depend on C.