-
Notifications
You must be signed in to change notification settings - Fork 30k
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
dgram: refactor dgram to module.exports #11696
dgram: refactor dgram to module.exports #11696
Conversation
Refactor dgram module to use the more efficient module.exports = {} pattern.
What's more efficient about this? I can see the benchmark, but are you saying every time we access one of the exported properties we take a perf hit? Even if so, this is so not on any hot code path, I see little point in doing this. Even if we did change this, we would have to change all built-in modules to follow that pattern. Has anyone discussed doing that yet? |
@TimothyGu Thank you, I wasn't aware this was already ongoing. LGTM 👍 |
@TimothyGu I think those are already fast properties without being exported this way? See #11430 |
Thanks! Landed in a9e64a8. |
Refactor dgram module to use the more efficient module.exports = {} pattern. PR-URL: #11696 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Ron Korving <ron@ronkorving.nl>
Refactor dgram module to use the more efficient module.exports = {} pattern. PR-URL: nodejs#11696 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Ron Korving <ron@ronkorving.nl>
Refactor dgram module to use the more efficient module.exports = {} pattern. PR-URL: nodejs#11696 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Ron Korving <ron@ronkorving.nl>
should we backport? |
I've labelled this as don't land. I believe that these optimizations were made with turbofan in mind. |
-1 on backporting. |
Refactor dgram module to use the more efficient
module.exports = {} pattern.
See #11611
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
dgram