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

benchmarks: add dgram bind(+/- params) benchmark #11313

Closed
wants to merge 1 commit into from
Closed

benchmarks: add dgram bind(+/- params) benchmark #11313

wants to merge 1 commit into from

Conversation

vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt commented Feb 11, 2017

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

benchmarks, dgram

This is a benchmark for this case requsted here.

An output from a separate run:
Before fix:

dgram\bind-params.js address="true"  port="true"  n=10000: 122,075.0274095059
dgram\bind-params.js address="false" port="true"  n=10000: 101,787.33470373016
dgram\bind-params.js address="false" port="false" n=10000: 101,181.97238774327

After fix:

dgram\bind-params.js address="true"  port="true"  n=10000: 123,071.85933260615
dgram\bind-params.js address="false" port="true"  n=10000: 123,060.85776592833
dgram\bind-params.js address="false" port="false" n=10000: 124,657.66978190755

An output from a comparing run:

                                                            improvement confidence      p.value
dgram\\bind-params.js address="false" port="false" n=10000      25.09 %        *** 2.923931e-40
dgram\\bind-params.js address="false" port="true"  n=10000      19.35 %        *** 1.138406e-32
dgram\\bind-params.js address="true"  port="true"  n=10000      -0.39 %            4.534955e-01

@nodejs-github-bot nodejs-github-bot added the benchmark Issues and PRs related to the benchmark subsystem. label Feb 11, 2017
@mscdex mscdex added the dgram Issues and PRs related to the dgram subsystem / UDP. label Feb 11, 2017
@vsemozhetbyt
Copy link
Contributor Author

vsemozhetbyt commented Feb 16, 2017

//cc @nodejs/benchmarking

@jasnell
Copy link
Member

jasnell commented Feb 16, 2017

@mscdex

@jasnell jasnell requested a review from mscdex February 16, 2017 22:58
}
bench.end(n);
} else if (address !== undefined) {
// Skip: the same as the previous case.
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this section can be omitted entirely (e.g. use address === undefined && port !== undefined for the below conditional)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, in this case, the last else should be replaced by else if (address === undefined && port === undefined), should not it?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's basically what I was suggesting, yes. Except perhaps it would be better to reverse the checks to match the same order used in the first conditional:

} else if (port !== undefined && address === undefined) {

or we could just remove the middle section entirely and it should still work as-is:

} else if (port !== undefined) {

const numberOfOperations = 1e4;

const configs = {
n: [numberOfOperations],
Copy link
Contributor

@mscdex mscdex Feb 16, 2017

Choose a reason for hiding this comment

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

I think this should just use the literal value inline, since it's the only place the variable is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I've just linted with no-magic-numbers, but this is not Node.js mandatory rule. I will fix it.

@vsemozhetbyt
Copy link
Contributor Author

vsemozhetbyt commented Feb 17, 2017

@mscdex Fixed (the results of comparing updated).

@ChALkeR ChALkeR mentioned this pull request Feb 17, 2017
2 tasks
@vsemozhetbyt
Copy link
Contributor Author

@mscdex @jasnell Could this be landed?

@mscdex
Copy link
Contributor

mscdex commented Feb 21, 2017

@mscdex
Copy link
Contributor

mscdex commented Feb 21, 2017

Linter shows green, LGTM.

@addaleax
Copy link
Member

Landed in 1162e28

@addaleax addaleax closed this Feb 21, 2017
addaleax pushed a commit that referenced this pull request Feb 21, 2017
Refs: #11242
PR-URL: #11313
Reviewed-By: Brian White <mscdex@mscdex.net>
@vsemozhetbyt vsemozhetbyt deleted the dgram-bind-benchmark branch February 21, 2017 19:25
addaleax pushed a commit that referenced this pull request Feb 22, 2017
Refs: #11242
PR-URL: #11313
Reviewed-By: Brian White <mscdex@mscdex.net>
@italoacasas italoacasas mentioned this pull request Feb 25, 2017
jasnell pushed a commit that referenced this pull request Mar 7, 2017
Refs: #11242
PR-URL: #11313
Reviewed-By: Brian White <mscdex@mscdex.net>
jasnell pushed a commit that referenced this pull request Mar 7, 2017
Refs: #11242
PR-URL: #11313
Reviewed-By: Brian White <mscdex@mscdex.net>
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
Refs: #11242
PR-URL: #11313
Reviewed-By: Brian White <mscdex@mscdex.net>
@MylesBorins MylesBorins mentioned this pull request Mar 9, 2017
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
Refs: #11242
PR-URL: #11313
Reviewed-By: Brian White <mscdex@mscdex.net>
@MylesBorins MylesBorins mentioned this pull request Mar 9, 2017
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.

5 participants