-
Notifications
You must be signed in to change notification settings - Fork 30.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nodejs:main' into fix-abort-listener-events-on
- Loading branch information
Showing
447 changed files
with
6,916 additions
and
18,754 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
const common = require('../common.js'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
type: ['URL', 'URLSearchParams'], | ||
n: [1e3, 1e6], | ||
}); | ||
|
||
function main({ type, n }) { | ||
const params = type === 'URL' ? | ||
new URL('https://nodejs.org').searchParams : | ||
new URLSearchParams(); | ||
|
||
bench.start(); | ||
for (let i = 0; i < n; i++) { | ||
params.append('test', i); | ||
} | ||
bench.end(n); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
const common = require('../common.js'); | ||
const assert = require('assert'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
searchParams: ['true', 'false'], | ||
property: ['pathname', 'search', 'hash'], | ||
n: [1e6], | ||
}); | ||
|
||
function getMethod(url, property) { | ||
if (property === 'pathname') return (x) => url.pathname = `/${x}`; | ||
if (property === 'search') return (x) => url.search = `?${x}`; | ||
if (property === 'hash') return (x) => url.hash = `#${x}`; | ||
throw new Error(`Unsupported property "${property}"`); | ||
} | ||
|
||
function main({ searchParams, property, n }) { | ||
const url = new URL('https://nodejs.org'); | ||
if (searchParams === 'true') assert(url.searchParams); | ||
|
||
const method = getMethod(url, property); | ||
|
||
bench.start(); | ||
for (let i = 0; i < n; i++) { | ||
method(i); | ||
} | ||
bench.end(n); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.