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

RpcRequestHandler优化 #80

Open
harrishee opened this issue Feb 23, 2024 · 2 comments
Open

RpcRequestHandler优化 #80

harrishee opened this issue Feb 23, 2024 · 2 comments

Comments

@harrishee
Copy link

想问下在RpcRequestHandler里对获取到的Method加个缓存会不会有性能上的提升/会不会有什么副作用?反射调用的invoke性能到底如何呢?

@xiaoguyueyue
Copy link
Contributor

第一个问号:没必要,反射获取的速度很快的,你缓存也是放到map里面,速度没什么提升,反而导致空间占用太大,得不偿失
第二个问号:反射调用的性能会比直接调用慢,但是这个项目很明显反射调用比直接调用好,而且速度瓶颈是网络

@harrishee
Copy link
Author

第一个问号:没必要,反射获取的速度很快的,你缓存也是放到map里面,速度没什么提升,反而导致空间占用太大,得不偿失 第二个问号:反射调用的性能会比直接调用慢,但是这个项目很明显反射调用比直接调用好,而且速度瓶颈是网络

感谢解答!理解了!

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

No branches or pull requests

2 participants