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

Performance investigation & results #1975

Closed
5 tasks done
alubbe opened this issue Jun 2, 2015 · 3 comments
Closed
5 tasks done

Performance investigation & results #1975

alubbe opened this issue Jun 2, 2015 · 3 comments

Comments

@alubbe
Copy link
Member

alubbe commented Jun 2, 2015

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:

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

@alubbe
Copy link
Member Author

alubbe commented Jun 6, 2015

Updated to reflect the fixes of points 4 & 5.
Fixing point 3 doesn't really yield a lot of performance and would be a breaking change, so I have dropped pursuing it.

Here are the final results of https://github.com/alubbe/jade-ejs-bench

alubbe's allimprovs branch
mixin-escape: 7457ms
mixin-no-escape: 2305ms
no-mixin-escape: 7884ms
no-mixin-no-escape: 1313ms
simple: 259ms

jade 1.10.0
mixin-escape: 44930ms
mixin-no-escape: 20945ms
no-mixin-escape: 28157ms
no-mixin-no-escape: 6409ms
simple: 404ms

EJS 2.3.1
mixin-escape: 6608ms
mixin-no-escape: 1653ms
no-mixin-escape: 7710ms
no-mixin-no-escape: 1456ms
simple: 310ms

EJS-TJ 2.3.2
mixin-escape: 5817ms
mixin-no-escape: 4074ms
no-mixin-escape: 7194ms
no-mixin-no-escape: 4063ms
simple: 183ms

I am very happy with those numbers!
@TimothyGu I'd love for you to bring the += to EJS. It should speed things up for that project, as well.

@TimothyGu
Copy link
Member

@alubbe that would be appreciated, thanks!

@regular
Copy link
Contributor

regular commented Jul 1, 2015

Awesome! Thanks for making Jade faster!

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

3 participants