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

No qualifying bean of type question

HCIP第十天_BGP路由汇总实验

qlib架构

产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开

View source and switch mirrors in two ways: npm and nrm

Win10 CUDA CUDNN 安装配置(torch paddlepaddle)

ERROR 1819 (HY000) Your password does not satisfy the current policy requirements

BUG destroyer!!Practical debugging skills are super comprehensive

手把手实现图片预览插件(三)

XSS靶场(三)prompt to win
随机推荐
Safety 20220715
【C语言进阶】文件操作(一)
MySQL based operations
MySQL database must add, delete, search and modify operations (CRUD)
binom二项分布,
Gaussian distribution and its maximum likelihood estimation
[CV project debugging] CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT problem
HCIP Day 10_BGP Route Summary Experiment
mysql数据库安装(详细)
扫雷小游戏——C语言
Vue项目通过node连接MySQL数据库并实现增删改查操作
[Linear Neural Network] softmax regression
Explanation of
Win10 CUDA CUDNN 安装配置(torch paddlepaddle)
【debug锦集】Expected input batch_size (1) to match target batch_size (0)
volatile内存语义以及实现 -volatile写和读对普通变量的影响
WPF WPF 】 【 the depth resolution of the template
【py脚本】批量二值化处理图像
View source and switch mirrors in two ways: npm and nrm
prompt.ml/15中<svg>标签使用解释