我们如何快速高效地进行Yaml合并

本文介绍了Unity在5.0版本中针对大型场景合并工具的优化,通过一系列改进,提高了合并工具的内存效率和速度。文章详细描述了合并过程,并展示了如何通过优化减少内存消耗和提高处理速度。
摘要由CSDN通过智能技术生成

In Unity 5.0, we shipped the scene and prefab merge tool, and It’s been positively received by the Unity Community. However, we’ve since realized that it doesn’t handle large scenes optimally, especially with respect to memory usage and the time taken to execute processes.

在Unity 5.0中,我们提供了场景和预制合并工具,并获得了Unity社区的好评。 但是,我们此后意识到,它不能最佳地处理大型场景,尤其是在内存使用情况和执行过程所花费的时间方面。

We’ve now worked on a number of changes to improve this, and they will go into future Unity release. As a result, the system is both more memory efficient and faster than other popular merge tools. Here’s a look at what we did.

现在,我们已经进行了许多更改以改进此更改,这些更改将在将来的Unity版本中使用。 结果,与其他流行的合并工具相比,该系统在存储效率和速度上均更高。 看看我们做了什么。

10英里概览 (How it works 10 mile overview)

This is roughly how the tool worked to begin with: Three files are read from disk (e.g. mine, incoming and base scene/prefab files) into an in-memory yaml structure exactly like the one we have inside Unity itself.

这大致就是该工具的工作方式:从磁盘读取三个文件(例如,矿山,传入和基础场景/预制文件)到内存中的yaml结构中,就像我们在Unity自身内部拥有的结构一样。

Now a diff is made between mine and base, and that results in a form of diff-tree describing which operation to perform on the base version yaml to get to the mine version yaml (mine/base diff). The same diff-tree is created for incoming and base (incoming/base diff).

现在,在我的和基础之间进行了区分,这形成了差异树的形式,描述了要对基本版本yaml执行哪个操作以获取到我的版本yaml (mine / base diff) 。 为传入基准 (传入/基准差异)创建相同的差异树

image03

The two diff-trees are now merged into one unified diff-tree (merged diff). This is the first point where conflicts can happen and the conflicts can be resolved by the user. Since the merged diff consists mostly of content from the two source diffs it simply references data inside the source diffs and we make sure their lifetimes exceed that of the merged diff-tree. After this merge is done the source diffs are considered invalid because they may have been rearranged during the merge.

现在,将两个差异树合并为一个统一的差异树(合并的差异)。 这是可能发生冲突并且用户可以解决冲突的第一点。 由于合并的差异主要包含来自两个源差异的内容࿰

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值