Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upos: improve networkInterfaces() performance #25410
Conversation
mscdex
added
os
performance
labels
Jan 9, 2019
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
the
C++
label
Jan 9, 2019
jdalton
reviewed
Jan 9, 2019
| if (existing !== undefined) | ||
| existing.push(entry); | ||
| else | ||
| result[name] = [entry]; | ||
| } |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jdalton
Jan 9, 2019
•
Member
At first glance it looks like a lot of unrolled code with an extra object being created. Could you please step me through the optimization being done in networkInterfaces(). If you drop the rework to networkInterfaces() do you still see perf wins?
This comment has been minimized.
This comment has been minimized.
mscdex
Jan 9, 2019
•
Author
Contributor
It's more or less moving the object creation from C++ to JS land, just like we do for CPU enumeration.
BridgeAR
reviewed
Jan 9, 2019
|
I personally wonder if it would not be faster to just move everything to C++ instead. The changes LGTM besides the result object. It should be kept as regular object. |
jasnell
approved these changes
Jan 9, 2019
mscdex
force-pushed the
mscdex:os-networkinterfaces-refactor
branch
from
d7b7cde
to
b505976
Jan 9, 2019
BridgeAR
approved these changes
Jan 10, 2019
This comment has been minimized.
This comment has been minimized.
BridgeAR
added
the
author ready
label
Jan 10, 2019
This comment has been minimized.
This comment has been minimized.
|
Landed in 5021b25. |
danbev
closed this
Jan 14, 2019
danbev
added a commit
that referenced
this pull request
Jan 14, 2019
mscdex
deleted the
mscdex:os-networkinterfaces-refactor
branch
Jan 14, 2019
addaleax
added a commit
that referenced
this pull request
Jan 14, 2019
Merged
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Jan 16, 2019
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
mscdex commentedJan 9, 2019
•
edited
With included benchmark:
and also makes the C++ implementation mirror the C++ cpu enumeration code for whatever that's worth.
CI: https://ci.nodejs.org/job/node-test-pull-request/20031/
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes