-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use with
?
#1
Comments
That have a little performance impact on compilation, but the impact is huge on running :
It became 7 times more long... It's a good improvement, I think the performance loss is to high to add it. (In the bench/ directory there is compile.js who is perfect to benchmark, you can comment other frameworks' tests to win time) |
Ok, so performance is your biggest concern for this module then. That is why I asked, because it is obviously slower to use Anyway, I just thought it was worth bringing up because the hard coded |
You have only tested template compilation, who run one time in an application, I have run template rendering, who run at each page load ;-)
Yes I know it may be not friendly at first use, but the performance decrease is too high to add it :-/
|
But I can add an option to choose the name of the variable, with `d` as default value ?
|
I tested compilation and rendering in one go. I agree that is not technically accurate to a use case, it was just my 2 second look at what the perf difference would be. I probably wont be using the module anyway, just thought I would give my feedback since you posted over on the express repo. But I do think that adding the option to change the variable name might help with other people wanting to use this, again just my 2c. |
Thanks for you feedback :-) I'm french, and not really good at english, I havn't understand "again just my 2c" 😅 |
Haha, no worries. "just my 2c" is an English saying which means "I am giving my personal opinion". See https://en.wikipedia.org/wiki/My_two_cents |
Oh ok thanks for explainations :-)
|
Typically I wouldn't ever recommend using
with
, but in this case it seems like it would improve the api of this module to switch to something like this:The performance hit is pretty minimal (see below), and it does not force users to have that
d.
strewn through their templates. What do you think? Or is the performance aspect the main focus of this package?Here is the perf test I did:
The text was updated successfully, but these errors were encountered: