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

Find out why doT is so much faster #49

Open
2 of 3 tasks
TimothyGu opened this issue Jan 26, 2015 · 5 comments
Open
2 of 3 tasks

Find out why doT is so much faster #49

TimothyGu opened this issue Jan 26, 2015 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@TimothyGu
Copy link
Collaborator

This is more of a WIP for myself.

WARNING: to anyone out there thinking tj/ejs is unreadable, please do not try on this task.

@TimothyGu TimothyGu added the help wanted Extra attention is needed label Jan 26, 2015
@TimothyGu
Copy link
Collaborator Author

Escape function ported in #50.

Now templates generated with !_with mode is about 55% as fast as doT's (which doesn't use with at all).

@TimothyGu
Copy link
Collaborator Author

Also note that even doT compilation is faster. By a lot. (By a lot I mean almost 500%.)

@TimothyGu TimothyGu added the enhancement New feature or request label Jan 29, 2015
@TimothyGu
Copy link
Collaborator Author

OK, after #50 and #56, !_with is about 60% faster than doT (yes!!!!), while using _with turns out to be marginally slower (<5%).

(Measured using client mode and copied the functions into a separate file. For some reason when using all functions in the same script as compilation makes EJS slower while making doT faster.)

Compilation is marginally faster as well.

@TimothyGu TimothyGu self-assigned this Feb 3, 2015
@bentinata
Copy link

I'm moving from Swig, as it unmaintained, and inbetween EJS and doT. I know you might be biased, but, what's the pros and cons of EJS and doT? Also, what should I do to make EJS better?

@TimothyGu
Copy link
Collaborator Author

@bentinata doT has an inherently more complex syntax, and thus a steeper learning curve is required. EJS is faster to learn, but once you get used to the doT "concise" syntax you might find a lot of <% if (...) -%> redundant. There isn't any way to make EJS "better" per se because EJS is designed to be simple and bare-bones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants