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

benchmark: fix dgram/bind-params.js benchmark #14948

Closed
wants to merge 2 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Aug 19, 2017

benchmark/dgram/bind-params exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.

$ node benchmark/run.js --filter bind-params dgram

dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: bind ENFILE 0.0.0.0
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
$
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

benchmark dgram

@Trott Trott added benchmark Issues and PRs related to the benchmark subsystem. dgram Issues and PRs related to the dgram subsystem / UDP. labels Aug 19, 2017
@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. dgram Issues and PRs related to the dgram subsystem / UDP. labels Aug 19, 2017
`benchmark/dgram/bind-params` exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.

```console
$ node benchmark/run.js --filter bind-params dgram

dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: bind ENFILE 0.0.0.0
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
$
```
@@ -19,19 +19,27 @@ function main(conf) {
if (port !== undefined && address !== undefined) {
bench.start();
for (let i = 0; i < n; i++) {
dgram.createSocket('udp4').bind(port, address).unref();
dgram.createSocket('udp4').bind(port, address)
.on('error', () => {})
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps pull this out to avoid creating n functions? I'm not sure what V8 optimizes away these days.

Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

LGTM with @mscdex's suggestion.

@Trott, feel free to drop this out if you disagree.
Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM

@Trott
Copy link
Member Author

Trott commented Aug 24, 2017

Trott added a commit to Trott/io.js that referenced this pull request Aug 24, 2017
`benchmark/dgram/bind-params` exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.

```console
$ node benchmark/run.js --filter bind-params dgram

dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: bind ENFILE 0.0.0.0
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
$
```

PR-URL: nodejs#14948
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott
Copy link
Member Author

Trott commented Aug 24, 2017

Landed in fffc84a

@Trott Trott closed this Aug 24, 2017
addaleax pushed a commit to addaleax/ayo that referenced this pull request Aug 25, 2017
`benchmark/dgram/bind-params` exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.

```console
$ node benchmark/run.js --filter bind-params dgram

dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: bind ENFILE 0.0.0.0
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
$
```

PR-URL: nodejs/node#14948
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Aug 28, 2017
`benchmark/dgram/bind-params` exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.

```console
$ node benchmark/run.js --filter bind-params dgram

dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: bind ENFILE 0.0.0.0
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
$
```

PR-URL: nodejs/node#14948
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
`benchmark/dgram/bind-params` exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.

```console
$ node benchmark/run.js --filter bind-params dgram

dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: bind ENFILE 0.0.0.0
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
$
```

PR-URL: #14948
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
`benchmark/dgram/bind-params` exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.

```console
$ node benchmark/run.js --filter bind-params dgram

dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: bind ENFILE 0.0.0.0
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
$
```

PR-URL: #14948
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Sep 20, 2017
`benchmark/dgram/bind-params` exits with an error frequently in its
current form because no error handler is applied. Add no-op error
handlers to avoid the problem.

```console
$ node benchmark/run.js --filter bind-params dgram

dgram/bind-params.js
dgram/bind-params.js address="true" port="true" n=10000:
193,347.42178656923
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: bind ENFILE 0.0.0.0
    at Object._errnoException (util.js:1041:11)
    at _exceptionWithHostPort (util.js:1064:20)
    at _handle.lookup (dgram.js:242:18)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:611:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
$
```

PR-URL: #14948
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Sep 20, 2017
@Trott Trott deleted the fix-bind-param branch January 13, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem. dgram Issues and PRs related to the dgram subsystem / UDP.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants