zllangct / ecs

A Go-implementation of the ECS (Entity-Component-System), focus on the development of game server.
BSD 3-Clause "New" or "Revised" License
132 stars 10 forks source link

关于优化器里 连续性优化 实现 #21

Open konglei-teclis opened 3 months ago

konglei-teclis commented 3 months ago

您好,最近我也在思考golang如何处理一些破碎内存的问题,想问下这边是准备如何实现处理 连续性 这块的优化?谢谢

zllangct commented 3 months ago

我个人不觉得golang内存碎片化上有什么问题,tcmalloc在内存碎片的处理上已经做得挺好的了,至少它不会是一个瓶颈点,当前ecs库的连续内存是使用数组来实现的,对数据类型有要求,对非内存展开的类型并不友好,在特定的情况下是好用的,通用场景下,我觉得实现成本远大于收益。

zllangct commented 3 months ago

使用arena实现了一个版本,但这不是一个release的特性