-
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
timers: move priority_queue to internal/timers/ #26876
Conversation
@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { | |||
}, { flags: ['--expose-internals'] }); | |||
|
|||
function main({ n, type }) { | |||
const PriorityQueue = require('internal/priority_queue'); | |||
const PriorityQueue = require('internal/timers/priority_queue'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should move this benchmark file to the timers
directory now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do that (and I think it's a fine idea), be sure to run test/benchmark/test-benchmark-timers
to make sure the move doesn't break that test file. (If it does break it, it should be easy to fix, but you may have to know something about how the benchmark tests work. Happy to help with that, although I'm guessing you'll figure it out if you aren't familiar with the benchmark tests already.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^^^ You'll want to run that test locally because the benchmark tests don't run in node-test-pull-request. (But they do run in node-daily-master so if it breaks, we'll find out, but not until after the code lands!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep👍.
And I've run python tools/test.py -J --mode=release benchmark/test-benchmark-timers
and this benchmark test passed, so I think it should be fine :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way you can use https://ci.nodejs.org/job/node-test-commit-custom-suites-freestyle/ to run this in the CI for this PR (use benchmark
in CI_JS_SUITES
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thank you.
It is only used in timers now but it could be also used for something else in future no? |
Benchmark CI (the testing one): https://ci.nodejs.org/job/node-test-commit-custom-suites-freestyle/5617/ |
AFAIK, It's a little hard for me to figure out other modules where Maybe /cc @nodejs/timers |
I do not see what purpose this PR is... Does this actually matter? |
Maybe slightly improve the tidiness of our |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting timers code in internal/timers/
seems reasonable to me.
I personally would keep it where it is due to possibly reusing it elsewhere at some point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s a generic implementation of a binary heap in JS. I see no reason to move it. Does this actually improve anything?
There was no any other affect, and I'm also willng to close this since majority wants keep it is as original. Still thanks all. |
The
priority_queue.js
is only used intimers
module, so maybe it's more reasonable to move it intointernal/timers/
specifically ?(I've used
git mv
command so I think it wouldn't hurt whengit blame priority_queue.js
)Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes