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

url: remove unused code from autoEscapeStr #15086

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
9 participants
@clakech
Contributor

clakech commented Aug 30, 2017

autoEscapeStr returned undefined when no character are escaped but this
behaviour seems useless when used into the parse function

Tests are OK on Mac, untested on Windows yet

@TimothyGu

This comment has been minimized.

Show comment
Hide comment
@TimothyGu

TimothyGu Aug 30, 2017

Member

Have you run the relevant benchmarks in benchmark/url/ to ensure this change does not incur any negative performance effects?

Member

TimothyGu commented Aug 30, 2017

Have you run the relevant benchmarks in benchmark/url/ to ensure this change does not incur any negative performance effects?

@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr Aug 30, 2017

Member

@TimothyGu since this is a first time contributor I ran the benchmarks myself.

To @clakech - after building Node you can run ./out/Release/node benchmark/... to run a benchmark.

The only relevant one I could find in benchmark/url was to test the performance of whatwg vs. legacy URLs.

I ran that twice on master and on master + this patch and got:

After Path:

url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long": 150,947.27802079343
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short": 408,202.1211496626
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn": 267,914.28921424143
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth": 257,618.88531914985
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file": 401,739.9550287473
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws": 272,934.07586904627
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript": 572,069.1155828064
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent": 435,524.0486231939
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot": 371,368.78158526303

Before:

url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long": 148,962.43618864467
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short": 341,602.16793580016
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn": 255,088.43262932872
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth": 249,252.04260117206
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file": 381,864.70300635014
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws": 269,496.3619379045
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript": 548,406.2242987709
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent": 429,998.2999157216
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot": 348,649.94617298077

Above everything, I'm not sure how stable it is - I don't think there should be a regression here and I don't think there is - but I'm not really sure how significant you'd like the statistical analysis to me.

Member

benjamingr commented Aug 30, 2017

@TimothyGu since this is a first time contributor I ran the benchmarks myself.

To @clakech - after building Node you can run ./out/Release/node benchmark/... to run a benchmark.

The only relevant one I could find in benchmark/url was to test the performance of whatwg vs. legacy URLs.

I ran that twice on master and on master + this patch and got:

After Path:

url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long": 150,947.27802079343
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short": 408,202.1211496626
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn": 267,914.28921424143
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth": 257,618.88531914985
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file": 401,739.9550287473
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws": 272,934.07586904627
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript": 572,069.1155828064
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent": 435,524.0486231939
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot": 371,368.78158526303

Before:

url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long": 148,962.43618864467
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short": 341,602.16793580016
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn": 255,088.43262932872
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth": 249,252.04260117206
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file": 381,864.70300635014
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws": 269,496.3619379045
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript": 548,406.2242987709
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent": 429,998.2999157216
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot": 348,649.94617298077

Above everything, I'm not sure how stable it is - I don't think there should be a regression here and I don't think there is - but I'm not really sure how significant you'd like the statistical analysis to me.

@TimothyGu

This comment has been minimized.

Show comment
Hide comment
@TimothyGu

TimothyGu Aug 30, 2017

Member

@benjamingr Yes that is the right benchmark.

@clakech Apologies. I'm currently on vacation, or otherwise I would have volunteered to run the benchmark myself.


One can get more statistically sound results by using the benchmark/compare.js script. Some documentation around using that script (and benchmarks in general) can be found in https://github.com/nodejs/node/blob/master/doc/guides/writing-and-running-benchmarks.md#comparing-nodejs-versions. Some tips:

  • --runs 10 will usually yield results that are statistically significant enough for benchmarks without I/O, but in 1/3 of the time.
  • --set method=legacy will prevent running unnecessary tests.

The script does require R to be installed on the system though. If that is not possible, simply post the generated CSV file on Gist and I'm sure one of us can run the R script to get the final results.

Member

TimothyGu commented Aug 30, 2017

@benjamingr Yes that is the right benchmark.

@clakech Apologies. I'm currently on vacation, or otherwise I would have volunteered to run the benchmark myself.


One can get more statistically sound results by using the benchmark/compare.js script. Some documentation around using that script (and benchmarks in general) can be found in https://github.com/nodejs/node/blob/master/doc/guides/writing-and-running-benchmarks.md#comparing-nodejs-versions. Some tips:

  • --runs 10 will usually yield results that are statistically significant enough for benchmarks without I/O, but in 1/3 of the time.
  • --set method=legacy will prevent running unnecessary tests.

The script does require R to be installed on the system though. If that is not possible, simply post the generated CSV file on Gist and I'm sure one of us can run the R script to get the final results.

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 30, 2017

Contributor

Hi, Thanks for your answers. I am here to learn so I am happy to follow your advices.

Right now I a build master and my branch to compares url.parse result using R.

Results may land here soon ;)

Contributor

clakech commented Aug 30, 2017

Hi, Thanks for your answers. I am here to learn so I am happy to follow your advices.

Right now I a build master and my branch to compares url.parse result using R.

Results may land here soon ;)

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 30, 2017

Contributor

ouch, bad results for performance:

$ node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 10 url > result.csv
[00:04:12|% 100| 1/1 files | 20/20 runs | 18/18 configs]: Done
$ cat result.csv | Rscript benchmark/compare.R

                                                                              improvement confidence    p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           -4.65 %            0.15437644
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"            -4.72 %            0.24024633
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"           -4.54 %            0.29057493
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"             3.59 %            0.41132403
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"     -4.62 %            0.17224892
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           -0.89 %            0.73415902
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"        -3.09 %            0.30922745
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"           0.67 %            0.84716433
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             -3.28 %            0.11715881
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="auth"           -0.40 %            0.90679273
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="dot"            -6.89 %            0.07398409
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="file"           -0.58 %            0.83759619
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="idn"             3.32 %            0.37233209
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="javascript"     -0.98 %            0.78286039
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="long"           -0.73 %            0.75686177
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="percent"        -1.98 %            0.56887389
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="short"          -1.87 %            0.53540313
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="ws"             -2.48 %            0.43679802
Contributor

clakech commented Aug 30, 2017

ouch, bad results for performance:

$ node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 10 url > result.csv
[00:04:12|% 100| 1/1 files | 20/20 runs | 18/18 configs]: Done
$ cat result.csv | Rscript benchmark/compare.R

                                                                              improvement confidence    p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           -4.65 %            0.15437644
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"            -4.72 %            0.24024633
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"           -4.54 %            0.29057493
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"             3.59 %            0.41132403
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"     -4.62 %            0.17224892
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           -0.89 %            0.73415902
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"        -3.09 %            0.30922745
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"           0.67 %            0.84716433
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             -3.28 %            0.11715881
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="auth"           -0.40 %            0.90679273
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="dot"            -6.89 %            0.07398409
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="file"           -0.58 %            0.83759619
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="idn"             3.32 %            0.37233209
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="javascript"     -0.98 %            0.78286039
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="long"           -0.73 %            0.75686177
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="percent"        -1.98 %            0.56887389
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="short"          -1.87 %            0.53540313
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="ws"             -2.48 %            0.43679802
@TimothyGu

This comment has been minimized.

Show comment
Hide comment
@TimothyGu

TimothyGu Aug 30, 2017

Member

The fact that none of the results have any *'s under "confidence" means we should be in the clear as the performance decrease is not statistically significant. You might want to increase the number of runs, however, to make the results more precise.

Also, ignore about the whatwg results: its code was not changed by this PR. You can add --set method=legacy to compare.js to avoid running those tests.

Another thing we might have to make sure is that the code path that was changed in this PR is actually tested by the benchmarks…

Member

TimothyGu commented Aug 30, 2017

The fact that none of the results have any *'s under "confidence" means we should be in the clear as the performance decrease is not statistically significant. You might want to increase the number of runs, however, to make the results more precise.

Also, ignore about the whatwg results: its code was not changed by this PR. You can add --set method=legacy to compare.js to avoid running those tests.

Another thing we might have to make sure is that the code path that was changed in this PR is actually tested by the benchmarks…

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 30, 2017

Contributor

I retried with --set method=legacy + a tiny modification for perf (see fixup commit):

node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 10 set method=legacy url > result.csv
[00:04:15|% 100| 1/1 files | 20/20 runs | 18/18 configs]: Done

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence      p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           10.70 %         ** 2.150621e-03
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"             1.74 %            6.314040e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"            5.97 %            9.664256e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"             2.54 %            3.976613e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"     -6.53 %          * 4.424086e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           18.94 %        *** 3.263359e-06
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"         1.65 %            5.574099e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"           9.23 %          * 3.651415e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             11.71 %          * 1.664590e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="auth"           -0.37 %            9.033986e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="dot"            -1.59 %            6.449899e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="file"           -1.16 %            6.880634e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="idn"             4.02 %            2.398871e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="javascript"     -1.73 %            5.226161e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="long"            5.81 %            1.238484e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="percent"         1.74 %            4.574058e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="short"           2.79 %            4.015245e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="ws"             -1.88 %            5.154173e-01
Contributor

clakech commented Aug 30, 2017

I retried with --set method=legacy + a tiny modification for perf (see fixup commit):

node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 10 set method=legacy url > result.csv
[00:04:15|% 100| 1/1 files | 20/20 runs | 18/18 configs]: Done

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence      p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           10.70 %         ** 2.150621e-03
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"             1.74 %            6.314040e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"            5.97 %            9.664256e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"             2.54 %            3.976613e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"     -6.53 %          * 4.424086e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           18.94 %        *** 3.263359e-06
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"         1.65 %            5.574099e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"           9.23 %          * 3.651415e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             11.71 %          * 1.664590e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="auth"           -0.37 %            9.033986e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="dot"            -1.59 %            6.449899e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="file"           -1.16 %            6.880634e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="idn"             4.02 %            2.398871e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="javascript"     -1.73 %            5.226161e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="long"            5.81 %            1.238484e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="percent"         1.74 %            4.574058e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="short"           2.79 %            4.015245e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="ws"             -1.88 %            5.154173e-01
@benjamingr

Given that there is no perf regression and code looks good - approving.

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 30, 2017

Contributor

Just another try to execute benchmark to double check perf and it seems good now:

node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 10 set method=legacy url > result.csv
[00:03:52|% 100| 1/1 files | 20/20 runs | 18/18 configs]: Done
 %                                                                                                                                                    

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence      p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"            9.60 %         ** 9.799862e-03
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"             7.21 %        *** 4.509781e-04
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"            7.18 %          * 1.168296e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"             1.17 %            6.286923e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"      2.43 %            3.716746e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           13.96 %        *** 8.696270e-05
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"         2.81 %            3.762799e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"           3.95 %            6.312936e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             12.10 %        *** 6.217701e-05
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="auth"            1.91 %            3.211612e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="dot"             5.33 %         ** 3.046581e-03
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="file"            2.57 %            2.099770e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="idn"             0.89 %            6.604443e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="javascript"      0.98 %            7.472758e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="long"            1.57 %            2.732665e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="percent"        -0.41 %            8.547598e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="short"          -0.67 %            7.670758e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="ws"              1.51 %            5.976787e-01

@benjamingr I added a tiny commit for perf, just to be sure you saw it 4b71730

Contributor

clakech commented Aug 30, 2017

Just another try to execute benchmark to double check perf and it seems good now:

node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 10 set method=legacy url > result.csv
[00:03:52|% 100| 1/1 files | 20/20 runs | 18/18 configs]: Done
 %                                                                                                                                                    

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence      p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"            9.60 %         ** 9.799862e-03
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"             7.21 %        *** 4.509781e-04
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"            7.18 %          * 1.168296e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"             1.17 %            6.286923e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"      2.43 %            3.716746e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           13.96 %        *** 8.696270e-05
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"         2.81 %            3.762799e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"           3.95 %            6.312936e-02
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             12.10 %        *** 6.217701e-05
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="auth"            1.91 %            3.211612e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="dot"             5.33 %         ** 3.046581e-03
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="file"            2.57 %            2.099770e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="idn"             0.89 %            6.604443e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="javascript"      0.98 %            7.472758e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="long"            1.57 %            2.732665e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="percent"        -0.41 %            8.547598e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="short"          -0.67 %            7.670758e-01
 url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="ws"              1.51 %            5.976787e-01

@benjamingr I added a tiny commit for perf, just to be sure you saw it 4b71730

@lpinca

lpinca approved these changes Aug 30, 2017

@benjamingr

This comment has been minimized.

Show comment
Hide comment
Member

benjamingr commented Aug 30, 2017

@clakech clakech closed this Aug 30, 2017

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 30, 2017

Contributor

Test regression spotted

Contributor

clakech commented Aug 30, 2017

Test regression spotted

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Aug 30, 2017

Member

@clakech did you mean to close the PR?

Member

jasnell commented Aug 30, 2017

@clakech did you mean to close the PR?

@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr Aug 30, 2017

Member

@clakech if you would like assistance with understanding the CI result or how to deal with it - please let us know. In Node.js pull requests are typically left open for 48 hours to discussion so collaborators have a chance to raise objections or concerns.

Member

benjamingr commented Aug 30, 2017

@clakech if you would like assistance with understanding the CI result or how to deal with it - please let us know. In Node.js pull requests are typically left open for 48 hours to discussion so collaborators have a chance to raise objections or concerns.

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 30, 2017

Contributor
Contributor

clakech commented Aug 30, 2017

@benjamingr benjamingr reopened this Aug 30, 2017

@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr Aug 30, 2017

Member

No problem, we won't land it as is.

Member

benjamingr commented Aug 30, 2017

No problem, we won't land it as is.

@benjamingr

Waiting until the tests are fixed. Let us know if you need help with that.

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 30, 2017

Contributor

Now tests are OK and here is the perf bench result:

node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 10 --set method=legacy url > result.csv
[00:01:57|% 100| 1/1 files | 20/20 runs | 9/9 configs]: Done

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence   p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           -2.17 %            0.5358442
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"             0.45 %            0.8961978
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"           -0.01 %            0.9980796
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"            -0.60 %            0.8925219
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"      1.95 %            0.5707394
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"            0.71 %            0.8435845
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"         0.49 %            0.9090416
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"          -0.37 %            0.9342886
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"              3.18 %            0.2445629
Contributor

clakech commented Aug 30, 2017

Now tests are OK and here is the perf bench result:

node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 10 --set method=legacy url > result.csv
[00:01:57|% 100| 1/1 files | 20/20 runs | 9/9 configs]: Done

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence   p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           -2.17 %            0.5358442
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"             0.45 %            0.8961978
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"           -0.01 %            0.9980796
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"            -0.60 %            0.8925219
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"      1.95 %            0.5707394
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"            0.71 %            0.8435845
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"         0.49 %            0.9090416
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"          -0.37 %            0.9342886
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"              3.18 %            0.2445629
Show outdated Hide outdated lib/url.js
@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr Aug 31, 2017

Member

Hey, can you push the recent changes?

Member

benjamingr commented Aug 31, 2017

Hey, can you push the recent changes?

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 31, 2017

Contributor

@benjamingr "Done", I just remove the perf tuning commit that introduce a regression... rollbacked to the first state of this PR now ;)

Contributor

clakech commented Aug 31, 2017

@benjamingr "Done", I just remove the perf tuning commit that introduce a regression... rollbacked to the first state of this PR now ;)

@benjamingr

This comment has been minimized.

Show comment
Hide comment
Member

benjamingr commented Aug 31, 2017

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 31, 2017

Contributor

I tried to bench with --runs 100 as suggested by @TimothyGu #15086 (comment) and with the modification proposed by @BridgeAR #15086 (comment) to be sure:

node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 100 --set method=legacy url > result.csv

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence   p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           -0.99 %            0.2587248
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"            -0.50 %            0.6006786
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"            0.87 %            0.3582855
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"             0.03 %            0.9783704
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"     -0.58 %            0.5305400
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           -0.20 %            0.7804390
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"         1.31 %            0.1699119
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"           0.47 %            0.5801138
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             -0.57 %            0.5023730

but

Comparing this perf result with the code without this @BridgeAR suggestion it is worse:

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence    p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           -1.44 %            0.11534475
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"            -0.21 %            0.82526706
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"           -0.60 %            0.51438710
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"            -1.96 %            0.05150804
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"     -1.01 %            0.30975298
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           -0.10 %            0.90420107
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"        -0.25 %            0.79938735
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"          -0.98 %            0.33971351
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             -0.97 %            0.26316218
Contributor

clakech commented Aug 31, 2017

I tried to bench with --runs 100 as suggested by @TimothyGu #15086 (comment) and with the modification proposed by @BridgeAR #15086 (comment) to be sure:

node benchmark/compare.js --old ../node/out/Release/node --new out/Release/node --filter legacy-vs-whatwg-url-parse.js --runs 100 --set method=legacy url > result.csv

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence   p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           -0.99 %            0.2587248
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"            -0.50 %            0.6006786
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"            0.87 %            0.3582855
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"             0.03 %            0.9783704
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"     -0.58 %            0.5305400
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           -0.20 %            0.7804390
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"         1.31 %            0.1699119
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"           0.47 %            0.5801138
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             -0.57 %            0.5023730

but

Comparing this perf result with the code without this @BridgeAR suggestion it is worse:

cat result.csv | Rscript benchmark/compare.R
                                                                              improvement confidence    p.value
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth"           -1.44 %            0.11534475
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot"            -0.21 %            0.82526706
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="file"           -0.60 %            0.51438710
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn"            -1.96 %            0.05150804
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="javascript"     -1.01 %            0.30975298
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long"           -0.10 %            0.90420107
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent"        -0.25 %            0.79938735
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short"          -0.98 %            0.33971351
 url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="ws"             -0.97 %            0.26316218
@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr Aug 31, 2017

Member

CI looks good to me (failure is unrelated https://ci.nodejs.org/job/node-test-commit-arm/11827//console ). Going to approve.

Member

benjamingr commented Aug 31, 2017

CI looks good to me (failure is unrelated https://ci.nodejs.org/job/node-test-commit-arm/11827//console ). Going to approve.

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 31, 2017

Contributor

@benjamingr I think @BridgeAR suggestion was good because it seems like it improves the performance compared to the actuel code (see #15086 (comment))

So I added this "if (lastEscapedPos === 0)" again in this fixup 5eeedc8

We may need to relaunch CI again #sorry

Contributor

clakech commented Aug 31, 2017

@benjamingr I think @BridgeAR suggestion was good because it seems like it improves the performance compared to the actuel code (see #15086 (comment))

So I added this "if (lastEscapedPos === 0)" again in this fixup 5eeedc8

We may need to relaunch CI again #sorry

@lpinca

This comment has been minimized.

Show comment
Hide comment
Member

lpinca commented Aug 31, 2017

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 31, 2017

Contributor

@lpinca the build result is aborted because of https://ci.nodejs.org/job/node-test-binary-arm/RUN_SUBSET=2,label=pi1-raspbian-wheezy/9930/console

...
[EnvInject] - Loading node environment variables.
FATAL: java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
...

Could someone reschedule another CI build please ? #thx

Contributor

clakech commented Aug 31, 2017

@lpinca the build result is aborted because of https://ci.nodejs.org/job/node-test-binary-arm/RUN_SUBSET=2,label=pi1-raspbian-wheezy/9930/console

...
[EnvInject] - Loading node environment variables.
FATAL: java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
...

Could someone reschedule another CI build please ? #thx

@lpinca

This comment has been minimized.

Show comment
Hide comment
@lpinca

lpinca Aug 31, 2017

Member

@clakech we can ignore infrastructure related failures.

Anyway here is a new CI: https://ci.nodejs.org/job/node-test-pull-request/9903/

Member

lpinca commented Aug 31, 2017

@clakech we can ignore infrastructure related failures.

Anyway here is a new CI: https://ci.nodejs.org/job/node-test-pull-request/9903/

@clakech

This comment has been minimized.

Show comment
Hide comment
@clakech

clakech Aug 31, 2017

Contributor

OK thanks @lpinca, we still got the same build error with ClosedChannelException

Contributor

clakech commented Aug 31, 2017

OK thanks @lpinca, we still got the same build error with ClosedChannelException

@TimothyGu

Looks much better. LGTM!

@BridgeAR

This comment has been minimized.

Show comment
Hide comment
@BridgeAR

BridgeAR Sep 3, 2017

Member

Landed in ed084a0

Member

BridgeAR commented Sep 3, 2017

Landed in ed084a0

@BridgeAR BridgeAR closed this Sep 3, 2017

BridgeAR added a commit to BridgeAR/node that referenced this pull request Sep 3, 2017

url: remove unused code from autoEscapeStr
PR-URL: nodejs#15086
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

addaleax added a commit to addaleax/ayo that referenced this pull request Sep 5, 2017

url: remove unused code from autoEscapeStr
PR-URL: nodejs/node#15086
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

MylesBorins added a commit that referenced this pull request Sep 10, 2017

url: remove unused code from autoEscapeStr
PR-URL: #15086
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

@MylesBorins MylesBorins referenced this pull request Sep 10, 2017

Merged

v8.5.0 proposal #15308

MylesBorins added a commit that referenced this pull request Sep 12, 2017

url: remove unused code from autoEscapeStr
PR-URL: #15086
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

MylesBorins added a commit that referenced this pull request Sep 20, 2017

url: remove unused code from autoEscapeStr
PR-URL: #15086
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

@MylesBorins MylesBorins referenced this pull request Sep 20, 2017

Merged

v6.11.4 proposal #15506

@clakech clakech deleted the clakech:urlAutoEscapeStrSimpler branch Sep 26, 2017

@clakech clakech restored the clakech:urlAutoEscapeStrSimpler branch Sep 26, 2017

sam-github added a commit to sam-github/node that referenced this pull request Oct 5, 2017

url: remove unused code from autoEscapeStr
PR-URL: nodejs#15086
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

sam-github added a commit to sam-github/node that referenced this pull request Oct 10, 2017

url: remove unused code from autoEscapeStr
PR-URL: nodejs#15086
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment