封闭的分支机构如何影响水银绩效? [英] How do closed branches affect Mercurial performance?

查看:65
本文介绍了封闭的分支机构如何影响水银绩效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到一些 引用Mercurial Wiki 表示每个功能分支或每个错误分支命名约定可能会导致性能问题.在提交时使用--close-branch标志将分支标记为已关闭的功能是否会对性能要求产生任何影响?

I've noticed that some answers to questions about branch names quote the Mercurial wiki to indicate that the branch-per-feature or branch-per-bug naming conventions may cause performance problems. Does the ability to mark branches as closed with the --close-branch flag on commits have any affect on this performance claim?

推荐答案

在提交时使用--close-branch标志将分支标记为已关闭的功能是否会对性能要求产生任何影响?

Does the ability to mark branches as closed with the --close-branch flag on commits have any affect on this performance claim?

hg commit --close-branch标记关闭的分支仅会在变更集元数据中使用close=1标记创建一个新的变更集.然后,像hg brancheshg heads这样的命令将不显示此分支/头.这些命令使用分支缓存来加快处理速度,我们希望该缓存能够随着分支数量的增长而很好地扩展.

Marking a branch closed with hg commit --close-branch merely creates a new changeset with a close=1 marker in the changeset meta data. Commands like hg branches and hg heads will then know not to show this branch/head. These commands use a branch cache to speed things up and we expect that cache to scale well with the number of branches.

但是,有些操作的复杂度与 topology 头的数量成线性关系.这包括在1.9版之前使用的发现协议. 1.9版中的新发现协议仍将在其样本"中交换拓扑头,但样本大小上限为200个变更集.

However, there are some operations that have a complexity that is linear in the number of topological heads. This includes the discovery protocol used before version 1.9. The new discovery protocol in version 1.9 will still exchange topological heads in its "samples", but the sample size is capped at 200 changesets.

可能还有其他代码路径仍按头数线性缩放,这就是为什么我们建议close-before-merge的原因:

There might be other code paths that still scale linearly in the number of heads and this is why we suggest close-before-merge:

$ hg update bug-123
$ hg commit --close-branch -m "All fixed"
$ hg update default
$ hg merge bug-123

而不是merge-before-close:

instead merge-before-close:

$ hg update default
$ hg merge bug-123
$ hg update bug-123
$ hg commit --close-branch -m "All fixed"

后一种方法在图中留下了一个悬空的头(一个拓扑头).

The latter approach leaves a dangling head in the graph (a topological head).

这篇关于封闭的分支机构如何影响水银绩效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆