Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unity]优化需求 #1952

Open
chexiongsheng opened this issue Dec 24, 2024 · 0 comments
Open

[Unity]优化需求 #1952

chexiongsheng opened this issue Dec 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@chexiongsheng
Copy link
Collaborator

chexiongsheng commented Dec 24, 2024

detail | 详细描述

il2cpp优化版本

  • 类型注册逻辑(TypeRegister.cs)放到c++实现:从C#侧反射获取Type或者MethodInfo等,会有一个il2cpp元数据对象到C#对象映射的一个缓存(或者说映射),这个缓存不会删除并且容量不够时翻倍扩容。
  • createFunction支持wrapper,这个依赖第一个,c++侧signature的计算。
  • 反射无gc,目前参数是值类型是无gc的,但返回值是值类型仍然有,可通过更底层的接口优化掉。
  • ObjectPool可以改为在C++实现
  • 私有函数访问也可以支持wrapper

全版本

  • createFunction支持FieldInfo转getter、setter
  • 支持js数组自动转C#数组

pinvoke版本

  • 看代码直接用pinvoke的Marshal比自己去调用Encoding.UTF8.GetBytes要快,要少gc
@chexiongsheng chexiongsheng changed the title [Unity]il2cpp优化 [Unity]优化 Dec 25, 2024
@chexiongsheng chexiongsheng changed the title [Unity]优化 [Unity]优化需求 Dec 25, 2024
@chexiongsheng chexiongsheng added the enhancement New feature or request label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant