当前位置:网站首页>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.
边栏推荐
猜你喜欢

mysql基础知识(二)

From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)

已解决(最新版selenium框架元素定位报错)NameError: name ‘By‘ is not defined

idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘
![[Linear Neural Network] softmax regression](/img/98/ffdff5e96ad0d6ac0142af7ca11e9a.png)
[Linear Neural Network] softmax regression

MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行

ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your

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

Industry landing presents new progress | 2022 OpenAtom Global Open Source Summit OpenAtom OpenHarmony sub-forum was successfully held

论治理与创新 | 2022开放原子全球开源峰会OpenAnolis分论坛圆满召开
随机推荐
Understanding of the presence of a large number of close_wait states
(Line segment tree) Summary of common problems of basic line segment tree
el-image tag doesn't work after binding click event
input输入框展示两位小数之precision
qlib自动化quant
已解决:不小心卸载pip后(手动安装pip的两种方式)
SOLVED: After accidentally uninstalling pip (two ways to manually install pip)
Safety 20220709
log level and print log note
Gaussian distribution and its maximum likelihood estimation
C# 实现PLC的定时器
exsl文件预览,word文件预览网页方法
(8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class
【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
ClickHouse: Setting up remote connections
idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘
Visual studio shortcuts that improve efficiency, summary (updated from time to time)
MySQL based operations
[shell basics] determine whether the directory is empty
MATLAB/Simulink & & STM32CubeMX tool chain completes model-based design development (MBD) (three)