Skip to content
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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/util/priority-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Copy link
Contributor

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?

Copy link
Member

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.)

Copy link
Member

@Trott Trott Mar 23, 2019

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!)

Copy link
Member Author

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 :)

Copy link
Member

@joyeecheung joyeecheung Mar 24, 2019

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thank you.

const queue = new PriorityQueue();
bench.start();
for (var i = 0; i < n; i++)
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const {
const { validateNumber } = require('internal/validators');

const L = require('internal/linkedlist');
const PriorityQueue = require('internal/priority_queue');
const PriorityQueue = require('internal/timers/priority_queue');

const { inspect } = require('internal/util/inspect');
let debuglog;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
'lib/internal/options.js',
'lib/internal/policy/manifest.js',
'lib/internal/policy/sri.js',
'lib/internal/priority_queue.js',
'lib/internal/process/esm_loader.js',
'lib/internal/process/execution.js',
'lib/internal/process/main_thread_only.js',
Expand All @@ -179,6 +178,7 @@
'lib/internal/socket_list.js',
'lib/internal/test/binding.js',
'lib/internal/timers.js',
'lib/internal/timers/priority_queue.js',
'lib/internal/tls.js',
'lib/internal/trace_events_async_hooks.js',
'lib/internal/tty.js',
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-bootstrap-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ const expectedModules = new Set([
'NativeModule internal/modules/cjs/helpers',
'NativeModule internal/modules/cjs/loader',
'NativeModule internal/options',
'NativeModule internal/priority_queue',
'NativeModule internal/process/execution',
'NativeModule internal/process/per_thread',
'NativeModule internal/process/promises',
'NativeModule internal/process/task_queues',
'NativeModule internal/process/warning',
'NativeModule internal/querystring',
'NativeModule internal/timers',
'NativeModule internal/timers/priority_queue',
'NativeModule internal/url',
'NativeModule internal/util',
'NativeModule internal/util/debuglog',
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-priority-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require('../common');

const assert = require('assert');
const PriorityQueue = require('internal/priority_queue');
const PriorityQueue = require('internal/timers/priority_queue');

{
// Checks that the queue is fundamentally correct.
Expand Down