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

Add Ada to Node.js #142

Closed
anonrig opened this issue Jan 27, 2023 · 7 comments · Fixed by #210
Closed

Add Ada to Node.js #142

anonrig opened this issue Jan 27, 2023 · 7 comments · Fixed by #210
Assignees
Labels

Comments

@anonrig
Copy link
Member

anonrig commented Jan 27, 2023

Current work in progress: nodejs/node#46410

@anonrig anonrig self-assigned this Jan 27, 2023
@anonrig
Copy link
Member Author

anonrig commented Jan 29, 2023

Current benchmark results:

                                                                                         confidence improvement accuracy (*)   (**)  (***)
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='false'                      -1.87 %       ±3.66% ±4.89% ±6.38%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='true'                        1.05 %       ±2.93% ±3.91% ±5.10%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='false'                       -3.34 %       ±3.79% ±5.06% ±6.62%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='true'                        -0.65 %       ±3.81% ±5.07% ±6.60%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='false'              ***     16.26 %       ±4.33% ±5.76% ±7.50%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='true'               ***     18.43 %       ±3.36% ±4.46% ±5.81%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='false'                       -1.17 %       ±3.32% ±4.45% ±5.84%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='true'                        -1.56 %       ±3.01% ±4.01% ±5.23%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='false'          *     -4.18 %       ±3.88% ±5.17% ±6.76%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='true'                  1.80 %       ±3.15% ±4.22% ±5.54%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='false'                       2.00 %       ±5.13% ±6.83% ±8.91%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='true'                        0.90 %       ±4.08% ±5.44% ±7.10%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='false'                   -0.44 %       ±2.57% ±3.42% ±4.46%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='true'                    -2.52 %       ±3.44% ±4.58% ±5.97%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='false'                      0.94 %       ±3.46% ±4.62% ±6.03%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='true'                       0.72 %       ±3.99% ±5.31% ±6.92%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='false'                        0.51 %       ±3.67% ±4.89% ±6.36%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='true'                        -0.16 %       ±3.57% ±4.76% ±6.20%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='false'                        -0.83 %       ±3.80% ±5.05% ±6.57%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='true'                         -1.22 %       ±3.70% ±4.92% ±6.40%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='false'              ***      7.03 %       ±2.96% ±3.94% ±5.13%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='true'               ***     42.76 %       ±2.80% ±3.74% ±4.88%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='false'               ***     18.29 %       ±3.97% ±5.30% ±6.93%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='true'                ***     63.56 %       ±2.88% ±3.86% ±5.08%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='false'               **      4.53 %       ±2.95% ±3.93% ±5.11%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='true'               ***     57.10 %       ±2.99% ±3.98% ±5.20%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='false'               ***      7.59 %       ±1.97% ±2.62% ±3.42%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='true'                ***     47.16 %       ±2.38% ±3.16% ±4.13%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='false'          *     -2.43 %       ±2.35% ±3.13% ±4.08%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='true'         ***     48.32 %       ±3.21% ±4.27% ±5.56%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='false'              ***     47.39 %       ±2.75% ±3.69% ±4.87%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='true'               ***     86.86 %       ±2.59% ±3.45% ±4.52%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='false'                    2.70 %       ±3.06% ±4.09% ±5.38%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='true'            ***     45.38 %       ±2.93% ±3.91% ±5.09%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='false'             ***     17.46 %       ±2.80% ±3.74% ±4.88%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='true'              ***     65.31 %       ±4.44% ±5.95% ±7.83%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='false'               ***     19.52 %       ±1.39% ±1.85% ±2.41%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='true'                ***     70.59 %       ±4.27% ±5.73% ±7.56%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='false'                ***      9.94 %       ±2.45% ±3.27% ±4.25%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='true'                 ***     55.71 %       ±2.11% ±2.81% ±3.66%

Be aware that when doing many comparisons the risk of a false-positive result increases.
In this case, there are 40 comparisons, you can thus expect the following amount of false-positive results:
  2.00 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.40 false positives, when considering a   1% risk acceptance (**, ***),
  0.04 false positives, when considering a 0.1% risk acceptance (***)

@anonrig

This comment was marked as outdated.

@lemire
Copy link
Member

lemire commented Jan 30, 2023

Currently, unless you changed something, ada will not use ICU under Windows.

@anonrig
Copy link
Member Author

anonrig commented Jan 30, 2023

Currently, unless you changed something, ada will not use ICU under Windows.

Yes, I'm running the tests on macOS for now. When all tests pass, I'll move over to Windows.

@TimothyGu
Copy link

@anonrig Do you have any figures on how Ada does against the existing Node.js WHATWG URL parser?

@anonrig
Copy link
Member Author

anonrig commented Feb 1, 2023

@TimothyGu This Comment is the initial benchmark result. With the current changes we did on main branch, Ada is now 85% faster than the default Node.js URL parser.

@TimothyGu
Copy link

Ah, I misread. Thank you! Great results indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants