forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
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 main
- Loading branch information
Showing
1,714 changed files
with
74,401 additions
and
66,480 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -196,6 +196,8 @@ For information about the governance of the Node.js project, see | |
**Robert Nagy** <<[email protected]>> | ||
* [ruyadorno](https://github.com/ruyadorno) - | ||
**Ruy Adorno** <<[email protected]>> (he/him) | ||
* [ShogunPanda](https://github.com/ShogunPanda) - | ||
**Paolo Insogna** <<[email protected]>> (he/him) | ||
* [targos](https://github.com/targos) - | ||
**Michaël Zasso** <<[email protected]>> (he/him) | ||
* [tniessen](https://github.com/tniessen) - | ||
|
@@ -333,8 +335,6 @@ For information about the governance of the Node.js project, see | |
**Debadree Chatterjee** <<[email protected]>> (he/him) | ||
* [deokjinkim](https://github.com/deokjinkim) - | ||
**Deokjin Kim** <<[email protected]>> (he/him) | ||
* [devnexen](https://github.com/devnexen) - | ||
**David Carlier** <<[email protected]>> | ||
* [devsnek](https://github.com/devsnek) - | ||
**Gus Caplan** <<[email protected]>> (they/them) | ||
* [edsadr](https://github.com/edsadr) - | ||
|
@@ -413,8 +413,6 @@ For information about the governance of the Node.js project, see | |
**Mestery** <<[email protected]>> (he/him) | ||
* [mhdawson](https://github.com/mhdawson) - | ||
**Michael Dawson** <<[email protected]>> (he/him) | ||
* [miladfarca](https://github.com/miladfarca) - | ||
**Milad Fa** <<[email protected]>> (he/him) | ||
* [mildsunrise](https://github.com/mildsunrise) - | ||
**Alba Mendez** <<[email protected]>> (she/her) | ||
* [MoLow](https://github.com/MoLow) - | ||
|
@@ -481,6 +479,8 @@ For information about the governance of the Node.js project, see | |
**Yash Ladha** <<[email protected]>> (he/him) | ||
* [ZYSzys](https://github.com/ZYSzys) - | ||
**Yongsheng Zhang** <<[email protected]>> (he/him) | ||
* [zcbenz](https://github.com/zcbenz) - | ||
**Cheng Zhao** <[email protected]> (he/him) | ||
|
||
<details> | ||
|
||
|
@@ -521,6 +521,8 @@ For information about the governance of the Node.js project, see | |
**David Cai** <<[email protected]>> (he/him) | ||
* [davisjam](https://github.com/davisjam) - | ||
**Jamie Davis** <<[email protected]>> (he/him) | ||
* [devnexen](https://github.com/devnexen) - | ||
**David Carlier** <<[email protected]>> | ||
* [digitalinfinity](https://github.com/digitalinfinity) - | ||
**Hitesh Kanwathirtha** <<[email protected]>> (he/him) | ||
* [dmabupt](https://github.com/dmabupt) - | ||
|
@@ -603,6 +605,8 @@ For information about the governance of the Node.js project, see | |
**Nicu Micleușanu** <<[email protected]>> (he/him) | ||
* [mikeal](https://github.com/mikeal) - | ||
**Mikeal Rogers** <<[email protected]>> | ||
* [miladfarca](https://github.com/miladfarca) - | ||
**Milad Fa** <<[email protected]>> (he/him) | ||
* [misterdjules](https://github.com/misterdjules) - | ||
**Julien Gilli** <<[email protected]>> | ||
* [mmarchini](https://github.com/mmarchini) - | ||
|
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,42 @@ | ||
'use strict'; | ||
|
||
const common = require('../common.js'); | ||
const { createHash, hash } = require('crypto'); | ||
const path = require('path'); | ||
const filepath = path.resolve(__dirname, '../../test/fixtures/snapshot/typescript.js'); | ||
const fs = require('fs'); | ||
const assert = require('assert'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
length: [1000, 100_000], | ||
method: ['md5', 'sha1', 'sha256'], | ||
type: ['string', 'buffer'], | ||
n: [100_000, 1000], | ||
}, { | ||
combinationFilter: ({ length, n }) => { | ||
return length * n <= 100_000 * 1000; | ||
}, | ||
}); | ||
|
||
function main({ length, type, method, n }) { | ||
let data = fs.readFileSync(filepath); | ||
if (type === 'string') { | ||
data = data.toString().slice(0, length); | ||
} else { | ||
data = Uint8Array.prototype.slice.call(data, 0, length); | ||
} | ||
|
||
const oneshotHash = hash ? | ||
(method, input) => hash(method, input, 'hex') : | ||
(method, input) => createHash(method).update(input).digest('hex'); | ||
const array = []; | ||
for (let i = 0; i < n; i++) { | ||
array.push(null); | ||
} | ||
bench.start(); | ||
for (let i = 0; i < n; i++) { | ||
array[i] = oneshotHash(method, data); | ||
} | ||
bench.end(n); | ||
assert.strictEqual(typeof array[n - 1], 'string'); | ||
} |
File renamed without changes.
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,45 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const common = require('../common.js'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
n: [1e6], | ||
method: ['timeOrigin', 'toJSON'], | ||
}); | ||
|
||
function main({ method, n }) { | ||
switch (method) { | ||
case 'timeOrigin': | ||
benchTimeOrigin(n); | ||
break; | ||
case 'toJSON': | ||
benchToJSON(n); | ||
break; | ||
default: | ||
throw new Error(`Unsupported method ${method}`); | ||
} | ||
} | ||
|
||
function benchTimeOrigin(n) { | ||
const arr = []; | ||
for (let i = 0; i < n; ++i) { | ||
arr.push(performance.timeOrigin); | ||
} | ||
|
||
bench.start(); | ||
for (let i = 0; i < n; i++) { | ||
arr[i] = performance.timeOrigin; | ||
} | ||
bench.end(n); | ||
|
||
assert.strictEqual(arr.length, n); | ||
} | ||
|
||
function benchToJSON(n) { | ||
bench.start(); | ||
for (let i = 0; i < n; i++) { | ||
performance.toJSON(); | ||
} | ||
bench.end(n); | ||
} |
Oops, something went wrong.