Skip to content

Conversation

@qlndzt
Copy link
Collaborator

@qlndzt qlndzt commented Dec 26, 2025

This PR is for:

Improves the performance of is_lua_process

Added benchmark

  • cpu

Benchmark result

<Paste benchmark results>

@kylewanginchina
Copy link
Contributor

@qlndzt 验证结果贴个图

@qlndzt
Copy link
Collaborator Author

qlndzt commented Jan 4, 2026

@qlndzt 验证结果贴个图

image 修改后profiler大概占用~1%cpu,修改前(python/lua都未处理)~100%

return 1;
}

detect_runtime_cached(pid as u32).is_some() as i32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看这里多加了一层cache,和直接用detect_runtime_uncached相比,性能上是能多优化很多吗?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是的,之前有stringifier lua的判断放在了最前面,这里主要是避免对非 Lua 进程反复扫maps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants