Skip to content

url: avoid instanceof for WHATWG URL#11690

Closed
mscdex wants to merge 1 commit intonodejs:masterfrom
mscdex:url-whatwg-perf
Closed

url: avoid instanceof for WHATWG URL#11690
mscdex wants to merge 1 commit intonodejs:masterfrom
mscdex:url-whatwg-perf

Conversation

@mscdex
Copy link
Contributor

@mscdex mscdex commented Mar 5, 2017

This PR replaces instanceof checks with symbol checks. Various relevant results:

                                                                             improvement confidence      p.value
 url/url-searchparams-read.js n=50000000 param="nonexistent" method="get"       195.08 %        *** 5.548226e-41
 url/url-searchparams-read.js n=50000000 param="nonexistent" method="getAll"    174.48 %        *** 3.225875e-29
 url/url-searchparams-read.js n=50000000 param="nonexistent" method="has"       190.68 %        *** 9.000669e-32
 url/url-searchparams-read.js n=50000000 param="one" method="get"               269.63 %        *** 2.180791e-33
 url/url-searchparams-read.js n=50000000 param="one" method="getAll"            111.73 %        *** 1.724534e-25
 url/url-searchparams-read.js n=50000000 param="one" method="has"               266.25 %        *** 5.498456e-33
 url/url-searchparams-read.js n=50000000 param="three" method="get"             203.56 %        *** 2.754902e-45
 url/url-searchparams-read.js n=50000000 param="three" method="getAll"          108.95 %        *** 1.790912e-35
 url/url-searchparams-read.js n=50000000 param="three" method="has"             198.65 %        *** 1.896093e-32
 url/url-searchparams-read.js n=50000000 param="two" method="get"               248.88 %        *** 4.737990e-41
 url/url-searchparams-read.js n=50000000 param="two" method="getAll"            112.93 %        *** 2.182157e-31
 url/url-searchparams-read.js n=50000000 param="two" method="has"               224.41 %        *** 2.056153e-30
 url/whatwg-url-properties.js n=10000000 prop="origin" input="auth"              12.59 %         ** 0.0035532598
 url/whatwg-url-properties.js n=10000000 prop="origin" input="dot"               10.53 %         ** 0.0041671062
 url/whatwg-url-properties.js n=10000000 prop="origin" input="file"              72.86 %        *** 0.0004049447
 url/whatwg-url-properties.js n=10000000 prop="origin" input="idn"                5.76 %            0.1494657794
 url/whatwg-url-properties.js n=10000000 prop="origin" input="javascript"        54.73 %         ** 0.0018129659
 url/whatwg-url-properties.js n=10000000 prop="origin" input="long"              10.20 %          * 0.0429791847
 url/whatwg-url-properties.js n=10000000 prop="origin" input="percent"            1.84 %            0.3920201593
 url/whatwg-url-properties.js n=10000000 prop="origin" input="short"             11.54 %        *** 0.0001064664
 url/whatwg-url-properties.js n=10000000 prop="origin" input="ws"                10.64 %         ** 0.0074980105

CI: https://ci.nodejs.org/job/node-test-pull-request/6707/

/cc @nodejs/url

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)
  • url-whatwg

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Issues and PRs related to the performance of Node.js. whatwg-url Issues and PRs related to the WHATWG URL implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants