GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing github.com — os: improve performance of hostname and homedir by Uzlopak · Pull Request #50037 · nodejs/node Conversation
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
f26183c to
344e221
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Updated the benchmark in initial post. We should discuss the caching. But this is the minimal consensus, which should be mergable. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Uzlopak do we have an idea how much time it takes in ms to get the homedir? If it's quick, I think we can land without a cache, the improvements are good enough. If it's slow, I think adding caching will not be bad, accords to docs: https://docs.libuv.org/en/v1.x/misc.html#c.uv_os_homedir doesn't look like this information will change during the execution of the process. We only need to worry about the snapshot. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I dont know how to measure the lookup time |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Code: const {homedir, hostname} = require('os') let now = performance.now(); let value = homedir(); console.log(`Diff: ${ performance.now() - now }ms`); now = performance.now(); value = hostname(); console.log(`Diff: ${ performance.now() - now }ms`); Output: Since we don't have any hot path calling this code multiple times, I think we can skip caching to not add complexity without a good reason. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
ah, you mean like that. Maybe programms like npm or pnpm need homedir more excessively. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Package managers are more likely to have I/O or compression/decompression be their bottleneck rather than something like |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@anonrig can you please add the author-ready tag? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mcollina can i interest you into reviewing this PR? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@anonrig |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The CI is locked. It seems the errors are fixed in main. Can you rebase and force push? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
216f85a to
ed76554
Compare
|
@anonrig |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@anonrig |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@anonrig can you give the CI some love please? :D |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@anonrig |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 0f0dd1a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
👍
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
👍
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #50037 Reviewed-By: Yagiz Nizipli <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.