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

补充: string 库章节 string.find 补充性能调优案例 #305

Open
Miss-you opened this issue Nov 18, 2020 · 0 comments
Open

补充: string 库章节 string.find 补充性能调优案例 #305

Miss-you opened this issue Nov 18, 2020 · 0 comments

Comments

@Miss-you
Copy link
Contributor

Miss-you commented Nov 18, 2020

string.find(s, p [, init [, plain]]) 这部分写的不够清楚,需要优化下

若不需要正则匹配,则使用print(find("abc cba", "(%a+)", 1, true))匹配方式性能会更高(可以被jit加速)

ref:
https://moonbingbing.gitbooks.io/openresty-best-practices/content/lua/string_library.html

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

1 participant