-
Notifications
You must be signed in to change notification settings - Fork 698
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
[unreal]结构体、容器成员Getter性能优化 #693
Comments
解决办法 1、结构体和容器cache分开;这样容器不会和结构体冲突,它可以正常cache; |
修改后,Get甚至比Set还要稍快一点 |
ForceNoCache也并不理想 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
目前获取结构体、容器成员,都是会new一个js对象承载结构体、容器的指针。开销比较大,实际测试Vector成员的Get会比Set慢几乎一个数量级。
最早是有个指针到js对象的缓存机制,后面去掉了。
回溯去掉的原因,当初是为了解决结构体嵌套,内外层指针相同导致冲突的问题。
比如如下类型:
FSomeData类型对象的指针,和其成员Alignment的指针是相同的,这样会导致someData.Alignment返回的是someData对象
而容器成员由于和结构体共享cache,也这么改了。
The text was updated successfully, but these errors were encountered: