-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
当模板文件比较大时,模板解析速度惨不忍睹 #539
Comments
关注ing~ |
https://github.com/aui/art-template/blob/master/lib/compile/tpl-tokenizer.js#L93 此处有无效的split,是否可以考虑增加如下判定:
|
我关注下 |
aui
added a commit
that referenced
this issue
Aug 21, 2018
已经修复 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
重现POC:
问题描述:
当模板文件越大,速度越慢,
art-template
的解析速度惨不忍睹.而同样的模板, 用
underscore
, 只需要几毫秒就完成了.主要问题出在 L93
https://github.com/aui/art-template/blob/master/lib/compile/tpl-tokenizer.js#L93
L38 的正则最后面可以匹配单个字符, L93在不区分任何情况的提前下,直接对
value
进行split('\n').length
导致, 速度变慢.The text was updated successfully, but these errors were encountered: