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

【llbc】对象池优化:GetStatistics优化 #333

Open
lailongwei opened this issue Dec 23, 2024 · 0 comments
Open

【llbc】对象池优化:GetStatistics优化 #333

lailongwei opened this issue Dec 23, 2024 · 0 comments

Comments

@lailongwei
Copy link
Owner

当前GetStatistics()时进行了lock,而获取统计信息本质上分成了两部分:

  • 生成统计信息
  • 对统计信息进行格式化

这其中的第一部分生成统计信息需要锁,而另外一部分是不需要的,这块也是简化设计导致,将使用上一版本的对象池实现思路进行优化:

  • 定义对象池统计的数据结构:LLBC_ObjPoolStatInfo,并于结构中提供Format()方法,让业务灵活调用、组装格式化后的信息
  • GetStatistics()还是进行锁,不过就变回跟上一版对象池一样:锁的过程中,只进行了统计数据结构的生成,而不会有格式化消耗
@lailongwei lailongwei added this to llbc Dec 23, 2024
@lailongwei lailongwei converted this from a draft issue Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant