Skip to content

Conversation

@vsemozhetbyt
Copy link
Contributor

@vsemozhetbytvsemozhetbyt 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-botnodejs-github-bot added the benchmark Issues and PRs related to the benchmark subsystem. label Feb 11, 2017
@mscdexmscdex added the dgram Issues and PRs related to the dgram subsystem / UDP. label Feb 11, 2017
@vsemozhetbyt
Copy link
ContributorAuthor

vsemozhetbyt commented Feb 16, 2017

//cc @nodejs/benchmarking

@jasnell
Copy link
Member

@mscdex

@jasnelljasnell requested a review from mscdexFebruary 16, 2017 22:58
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
ContributorAuthor

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

Copy link
Contributor

@mscdexmscdexFeb 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
ContributorAuthor

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
ContributorAuthor

vsemozhetbyt commented Feb 17, 2017

@mscdex Fixed (the results of comparing updated).

@ChALkeRChALkeR mentioned this pull request Feb 17, 2017
2 tasks
@vsemozhetbyt
Copy link
ContributorAuthor

@mscdex@jasnell Could this be landed?

@mscdex
Copy link
Contributor

@mscdex
Copy link
Contributor

Linter shows green, LGTM.

@addaleax
Copy link
Member

Landed in 1162e28

addaleax pushed a commit that referenced this pull request Feb 21, 2017
@vsemozhetbytvsemozhetbyt deleted the dgram-bind-benchmark branch February 21, 2017 19:25
addaleax pushed a commit that referenced this pull request Feb 22, 2017
@italoacasasitaloacasas mentioned this pull request Feb 25, 2017
jasnell pushed a commit that referenced this pull request Mar 7, 2017
jasnell pushed a commit that referenced this pull request Mar 7, 2017
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
@MylesBorinsMylesBorins mentioned this pull request Mar 9, 2017
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
@MylesBorinsMylesBorins mentioned this pull request Mar 9, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmarkIssues and PRs related to the benchmark subsystem.dgramIssues and PRs related to the dgram subsystem / UDP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@vsemozhetbyt@jasnell@mscdex@addaleax@nodejs-github-bot