当前位置:网站首页>Lua,ILRuntime, HybridCLR(wolong)/huatuo hot update comparative analysis
Lua,ILRuntime, HybridCLR(wolong)/huatuo hot update comparative analysis
2022-07-31 04:44:00 【Clank's Game Stack】
Foreword
In the past two years, various Unity hot update solutions have sprung up. Today, I will write an article to compare the advantages and disadvantages of Unity's major hot update solutions.The current mainstream Unity hot update solutions are:


Next, we will analyze and compare these hot update schemes from several points:
(1) The range of code that can be hot-updated;
(2) When a new version is released, the performance of the new version is hotly updated with the old version;
(3) A comparative analysis of the execution efficiency of hot more explanations;
(4) Which solution is more in line with the developer's development habits;
Range comparison of hot-updateable code
Lua, the solution is a built-in Lua virtual machine of the project. The scope of its hot update is that all scripts developed using Lua can be hot updated, and the code developed in C# can be hot updated by hotfix in advance.Although the Lua solution looks like both Lua code and C# code can be updated, in fact, when hotfix is used for hot update of C# code, it needs to be marked. You cannot predict which needs C# may be updated. At the same time, hotfix is iterated through several versions., the previous version has hot patches, the new version does not have hot patches, which is very troublesome to manage.

In this game, HybridCLR(wolong) huatuo won.You can update any code implemented by C#. If you want to hot update, load the .dll bytecode library where the c# code is located into the il2cpp vm to be interpreted and executed. If you do not load the .dll bytecode, use the original il2cppthe native code.
New version performance and old version hot update
This game is also a complete victory for HybridCLR(wolong) huatuo. When a new version is sent, such as 1.0, we have developed some hot-update codes. When 2.0 is released, the 1.0 version is hot-updated on the server.Code interpretation and execution, 2.0 is a direct code, but Lua/purets/ILRuntime 2.0 version is interpreted and executed, and HybridCLR (wolong) huatuo, 1.0 is to load the updated .dll to the il2cpp vm virtual machine, interpret and execute IL bytescode.But when we release 2.0, we don't need to load .dll, so the native code converted by 2.0 il2cpp can be directly executed by the machine, so other solutions are interpreted and executed, and the new version of HybridCLR (wolong) huatuo is native code.To sum up the Lua/ILRuntime/puerts hot update solution, the new version interprets and executes the hot update code, while HybridCLR (wolong) huatuo uses native code to run directly. The native performance of the new version is better than the interpretation and execution performance.
Comparative analysis of the execution efficiency of hot update explanations
The above analysis shows that in the new version, Lua/ILRuntime/puerts is still interpreted and executed, while HybridCLR(wolong) huatuo is native code. Next, we will analyze the comparison between the execution efficiency and performance of hot more explanations. Lua/ILRuntime/puerts is a built-in virtual machine in the C# layer, so the memory of the hot code is the memory object running in the virtual machine domain. If you want to access the native c# object, you must wrap it with a function to access it, and HybridCLR (wolong) When huatuo interprets and executes the IL bytecode, it first maps the object memory of the bytecode into a native memory block. Therefore, while interpreting and executing the IL bytecode, huatuo can directly access the native memory object.In this way, you don't need to wrap it with functions like other hot updates, and the performance is the best.The memory access of data objects has been discussed. Next, we will look at the interpretation and execution, which are all binary bytecode interpretations. The efficiency of these interpretations and executions is basically an order of magnitude. Since HybridCLR (wolong) huatuo can directly access native memory objects, soHybridCLR(wolong) huatuo is better than other schemes in the execution performance of the hot update part.
Which solution is more suitable for developers' development habits
HybridCLR(wolong) huatuo wins this game again. When using the HybridCLR(wolong) huatuo hot update solution, you don't need to worry about which ones need to be updated and which ones don't need to be updated, just use Unity's ADF mechanism to generate different modules according to the modules.project, and generate the corresponding .dll. When the bottom layer is packaged, they are all converted into native code with il2cpp. If the new version of the .dll needs to be updated, just put the generated new version of the .dll on the server, then fromThe server is loaded into the il2cpp vm so that it can be interpreted and executed.So HybridCLR(wolong) huatuo is almost the same as normal Unity development.

Through several comparisons, the il2cpp vm-based hot update solution represented by HybridCLR(wolong) huatuo will be the mainstream choice for Unity's hot update solution.If nothing else, the future trend of hot update is the hot update solution based on the technical principle of HybridCLR (wolong) huatuo.
The sharing of this section is here, enter the homepage study group, you can learn video tutorials, framework design related knowledge.
边栏推荐
- C# 实现PLC的定时器
- ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
- ClickHouse:设置远程连接
- 【AUTOSAR-RTE】-4-Port and Interface and Data Type
- IDEA common shortcut keys and plug-ins
- pom文件成橘红色未加载的解决方案
- 手把手实现图片预览插件(三)
- Industry-university-research application to build an open source talent ecosystem | 2022 Open Atom Global Open Source Summit Education Sub-Forum was successfully held
- open failed: EACCES (Permission denied)
- Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
猜你喜欢

Reinforcement learning: from entry to pit to shit

三道leetcode上的oj题

BUG destroyer!!Practical debugging skills are super comprehensive

递归实现汉诺塔问题

MySQL based operations
![[C language] General method of base conversion](/img/28/954af5f47a79ff02d3cc0792ac8586.jpg)
[C language] General method of base conversion

BUG消灭者!!实用调试技巧超全整理

Fusion Cloud Native, Empowering New Milestones | 2022 Open Atom Global Open Source Summit Cloud Native Sub-Forum Successfully Held

Notes on the establishment of the company's official website (6): The public security record of the domain name is carried out and the record number is displayed at the bottom of the web page

从零开始,一镜到底,纯净系统搭建除草机(Grasscutter)
随机推荐
C语言表白代码?
MATLAB/Simulink&&STM32CubeMX工具链完成基于模型的设计开发(MBD)(三)
论治理与创新 | 2022开放原子全球开源峰会OpenAnolis分论坛圆满召开
log level and print log note
(5) final, abstract class, interface, inner class
.NET-6.WinForm2.NanUI学习和总结
HCIP Day 10_BGP Route Summary Experiment
C language from entry to such as soil, the data store
unity2d小游戏
BUG消灭者!!实用调试技巧超全整理
益智类游戏关卡设计:逆推法--巧解益智类游戏关卡设计
Recursive implementation of the Tower of Hanoi problem
qlib架构
(Line segment tree) Summary of common problems of basic line segment tree
马斯克对话“虚拟版”马斯克,脑机交互技术离我们有多远
open failed: EACCES (Permission denied)
ClickHouse: Setting up remote connections
Why don't you programmers make a living off your own projects?And have to work for someone else?
聚变云原生,赋能新里程 | 2022开放原子全球开源峰会云原生分论坛圆满召开
【debug锦集】Expected input batch_size (1) to match target batch_size (0)