-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
eejs is using blocking API :: Wont fix as it doesn't actually effect performance noticably. #642
Comments
This is a hard one to solve, since all of EJS is using function calls with return values, not callbacks. eejs is justa function library for embedded javascript within a normal EJS template, and so must return the values that are to be used in the template. |
The alternative would be a total rewrite of EJS into a non-blocking framework. |
We could also switch to something besides ejs. There are quite a view node templating systems. Don't know which are non-blocking though. |
This is alsp partly related to the node.js require() api being CommonJS synchronous modules, not http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition which can be solved by using http://requirejs.org/docs/node.html |
|
@redhog any update on this? :| |
|
|
We're still yet to hit this issue as being a performance bottle neck despite lots of load testing. With that in mind we're not too concerned about the current eejs implementation.. If anyone wants to share an opinion please go for it :) |
How much third-party code depends on ejs? It may be better to switch to a different engine that handles async well, unless it'll break a lot of code. Alternatively, we could just cache the templates in memory and only read them from disk once. |
Actually, I see a quick performance win in eejs with caching the templates; let me take a stab at that and I'll get back to you. |
This is still true as of today: etherpad-lite/src/node/eejs/index.js Line 117 in c966480
Just for info, as part of #3540, @raybellis already migrated a big part of the codebase to async/await. That work will be part of 1.8. Sadly, eejs is stuck in the past. |
Afaik w/ the recent minification / caching efforts we're in a pretty good place. I'm not sure we will get much gains from this change? |
Only testing could tell us. I would leave this open, because the issue is different than minification/caching and is a good PITA to increase the desire to modernize the code base. |
readFileSync blocks the event loop until the file is read so it should not be used on every request: https://github.com/Pita/etherpad-lite/blob/7cf4510bf545927edead70931befb7d62ca5863c/src/node/eejs/index.js#L104
//cc @redhog
The text was updated successfully, but these errors were encountered: