Uh oh!
There was an error while loading. Please reload this page.
crypto: make createXYZ inlineable - #16067
Conversation
mcollina
commented
Oct 7, 2017
This is just an example. We should do the same for all the rest of the |
mscdex
commented
Oct 7, 2017
Yes, I think we should be doing it for the rest as well. |
mcollina
commented
Oct 7, 2017
The reason it was not inlining was with the following output: |
mcollina
commented
Oct 7, 2017
@mscdex do you prefer if we do all of them here, or we do this into separate PRs? |
TimothyGu
left a comment
There was a problem hiding this comment.
With the understanding that this is going to be done with all the other creation functions, LGTM.
bmeurer
left a comment
There was a problem hiding this comment.
LGTM.
For the record: We removed the recursive inlining restriction recently.
mcollina
commented
Oct 7, 2017
@bmeurer is this worth doing then? In which version of V8 this is going to be part of? |
625e27b to
a6a2f89Comparemcollina
commented
Oct 7, 2017
I have ported all the createXYZ functions. |
I think it's worth doing for now, especially for node v8.x which may not see the version of V8 where the fixed is applied. |
mscdex
commented
Oct 7, 2017
There was a problem hiding this comment.
Please add a quick comment explaining the optimization.
a6a2f89 to
6042f8eComparemcollina
commented
Oct 7, 2017
@bengl done. |
bmeurer
commented
Oct 8, 2017
@mcollina I just noticed that we still disallow direct recursive inlining (as of 08bfcb293cfff2d71bcfb28fae8679d0b29a3d5c), so even though indirect recursion is handled, direct recursion is not. These changes are in V8 6.2. So for Node 8 it definitely makes sense to land this change. |
There was a problem hiding this comment.
Minor nits:
s/function/helper functions/
Also, might use more generic wording like 'These helper functions are needed because the constructors can use new, in which case V8 cannot inline the recursive constructor call' or something along those lines.
This commit increase by around 10% hot code paths that are hitting createXYZ functions. Before this change the createXYZ called the XYZ constructor without new.
6042f8e to
4e61acbComparemcollina
commented
Oct 9, 2017
CI before landing: https://ci.nodejs.org/job/node-test-pull-request/10523/ |
mcollina
commented
Oct 9, 2017
Landed as 9bc4f86 |
This commit increase by around 10% hot code paths that are hitting createXYZ functions. Before this change the createXYZ called the XYZ constructor without new. PR-URL: #16067 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit increase by around 10% hot code paths that are hitting createXYZ functions. Before this change the createXYZ called the XYZ constructor without new. PR-URL: nodejs/node#16067 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins
commented
Oct 23, 2017
This does not land cleanly on v8.x Would someone be willing to backport if it makes sense? |
lpinca
commented
Oct 24, 2017
assert.strictEqual(crypto.createHash,crypto.Hash);et al. throw with this change, should we backport anyway? |
MylesBorins
commented
Oct 24, 2017
@lpinca if it is breaking than this should likely be tagged semver-major, if not then I don't see why we shouldn't backport |
lpinca
commented
Oct 24, 2017
@MylesBorins yes exactly I'm not sure if it's a breaking change or not. |
MylesBorins
commented
Oct 24, 2017
setting semver-major for right now /cc @nodejs/tsc to chime in. Feel free to change tag |
mcollina
commented
Oct 24, 2017
According to our doc, this is patch. if people are calling createHash with new, probably they are doing somethig wrong. This can go in 8. Or we can bake it for a bit on 9 and then backport to 8. |
jasnell
commented
Oct 24, 2017
I'm +1 on it being semver-patch. |
This commit increase by around 10% hot code paths that are hitting createXYZ functions. Before this change the createXYZ called the XYZ constructor without new. PR-URL: nodejs#16067 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
lpinca
commented
Oct 24, 2017
Backport in #16446 marked as blocked currently. |
MylesBorins
commented
Oct 24, 2017
dropping semver-major. Thinking we should let this bake in 9.x a bit first |
This commit increase by around 10% hot code paths that are hitting createXYZ functions. Before this change the createXYZ called the XYZ constructor without new. PR-URL: #16067 Backport-PR-URL: #16446 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit increase by around 10% hot code paths that are hitting createXYZ functions. Before this change the createXYZ called the XYZ constructor without new. PR-URL: #16067 Backport-PR-URL: #16446 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit increase by around 10% hot code paths that are hitting
createXYZ functions. Before this change the createXYZ called the XYZ
constructor without new.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
crypto