当前位置:网站首页>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模糊查询可以使用INSTR替代LIKE
- Safety 20220709
- npm、nrm两种方式查看源和切换镜像
- 重磅 | 基金会为白金、黄金、白银捐赠人授牌
- 行业落地呈现新进展 | 2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛圆满召开
- ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
- Vue项目通过node连接MySQL数据库并实现增删改查操作
- PCL 计算点云坐标最值及其索引
- 专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础
- Fusion Cloud Native, Empowering New Milestones | 2022 Open Atom Global Open Source Summit Cloud Native Sub-Forum Successfully Held
猜你喜欢
prompt.ml/15中<svg>标签使用解释
Unity Fighter
产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开
Postgresql 15 source code analysis (5) - pg_control
Exsl file preview, word file preview web page method
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
三子棋的代码实现
Hand in hand to realize the picture preview plug-in (3)
Industry-university-research application to build an open source talent ecosystem | 2022 Open Atom Global Open Source Summit Education Sub-Forum was successfully held
重磅 | 开放原子校源行活动正式启动
随机推荐
【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
STM32HAL library modifies Hal_Delay to us-level delay
Unity打灵狐者
HCIP Day 10_BGP Route Summary Experiment
ClickHouse:设置远程连接
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
【云原生】DevOps(五):集成Harbor
BUG destroyer!!Practical debugging skills are super comprehensive
聚变云原生,赋能新里程 | 2022开放原子全球开源峰会云原生分论坛圆满召开
IDEA common shortcut keys and plug-ins
【线性神经网络】softmax回归
exsl文件预览,word文件预览网页方法
log level and print log note
Industry-university-research application to build an open source talent ecosystem | 2022 Open Atom Global Open Source Summit Education Sub-Forum was successfully held
Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
MySQL based operations
Go语学习笔记 - 处理超时问题 - Context使用 | 从零开始Go语言
Understanding of the presence of a large number of close_wait states
(6) Enumeration and annotation
重磅 | 基金会为白金、黄金、白银捐赠人授牌