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

将指令集缓存设置成静态变量 #344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YuanHao97
Copy link

ExpressRunner进行初始化时,如果没有使用单例,有可能会导致成员变量expressInstructionSetCache每次都不会命中,每次都需要进行重新生成指令集,效率很低。
ExpressRunner expressRunner = new ExpressRunner();
将指令集缓存设置成静态变量可以解决这个问题。

@DQinYuan
Copy link
Collaborator

ExpressRunner 建议使用单例,如果不采用单例的话,不止这一处,QLPattern 的语法解析树每次也要重新初始化

@YuanHao97
Copy link
Author

YuanHao97 commented Sep 22, 2024 via email

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