-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Performance investigation & results #1975
Comments
Updated to reflect the fixes of points 4 & 5. Here are the final results of https://github.com/alubbe/jade-ejs-bench alubbe's allimprovs branch jade 1.10.0 EJS 2.3.1 EJS-TJ 2.3.2 I am very happy with those numbers! |
@alubbe that would be appreciated, thanks! |
Awesome! Thanks for making Jade faster! |
I've been wanting to give an update on how my benchmarks are coming along and what I have been finding. My findings are about increasing the number of HTML strings per second generated by a compiled, cached function - not about improving the speed of lexing or parsing.
My approach is to analyse and improve the output produced by these jade files: https://github.com/alubbe/jade-ejs-bench/tree/master/jade
I am taking the output produced by jade and comparing it with a) output produced by EJS and b) best practices for letting v8 optimize functions.
Here are the current findings:
each
has to perform runtime checks whether to iterate of an array or object, making it a bit slower than two separate iteration implementations (<5%, let's leave it as is)each
runs in an IIFE for variable scoping, losing quite a bit of performance (~20%, fixed by for loops are now generated inline rather than in an IIFE #1983)I'm continuing my search in irregular intervals and will report them here. Would love to hear feedback and/or further things to investigate.
Sources:
https://github.com/alubbe/jade-ejs-bench
http://jsperf.com/jade-better-escape
http://jsperf.com/html-compilers/2
http://jsperf.com/html-compilers/3
The text was updated successfully, but these errors were encountered: