Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bac55f7
deps: update simdjson to 3.7.0
lemire Feb 25, 2024
a4dd041
test: deflake test-http2-large-write-multiple-requests
joyeecheung Feb 23, 2024
9ac98b1
lib: do not access process.noDeprecation at build time
joyeecheung Feb 26, 2024
fc0f2cf
lib,src: extract sourceMappingURL from module
unbyte Feb 6, 2024
4556445
util: add styleText API to text formatting
RafaelGSS Feb 26, 2024
0350609
deps: update ngtcp2 to 1.3.0
nodejs-github-bot Feb 26, 2024
123dc51
doc: change `ExperimentalWarnings` to `ExperimentalWarning`
akaustav Feb 26, 2024
60f09c6
src: stop the profiler and the inspector before snapshot serialization
joyeecheung Feb 20, 2024
6cb8a60
test_runner: add ref methods to mocked timers
marco-ippolito Feb 26, 2024
60ce078
http: fix `close` return value mismatch between doc and implementation
kylo5aby Feb 26, 2024
399654f
events: no stopPropagation call in cancelBubble
Oct 26, 2023
6bb7c4d
tools: update eslint to 8.57.0
nodejs-github-bot Feb 27, 2024
4cae1b9
lib: move encodingsMap to internal/util
joyeecheung Dec 4, 2023
4c46439
crypto: implement crypto.hash()
joyeecheung Jan 5, 2024
7824a79
doc: update guide link for Event Loop
shrujalshah28 Feb 27, 2024
292016c
net: fix connect crash when call destroy in lookup handler
theanarkh Feb 27, 2024
f28ccd3
doc: add website team to sharing project news
UlisesGascon Feb 27, 2024
73f150b
src: simplify direct queries of env vars in C++ land
joyeecheung Feb 27, 2024
a51efa2
stream: fix eventNames() to not return not defined events
IlyasShabi Feb 27, 2024
6c080f6
benchmark: update iterations of benchmark/assert/deepequal-map.js
Feb 28, 2024
e8de0f5
benchmark: update iterations of assert/deepequal-typedarrays.js
Feb 28, 2024
a8eaa0d
doc: update node-api/node-addon-api team link to sharing project news
UlisesGascon Feb 28, 2024
2f01f02
doc: remove redundant backquote which breaks sentence
JounQin Feb 28, 2024
8a94177
meta: move one or more collaborators to emeritus
nodejs-github-bot Feb 28, 2024
8e7da60
test: test surrogate pair filenames on windows
mertcanaltin Feb 18, 2024
f4af4b1
perf_hooks: performance milestone time origin timestamp improvement
IlyasShabi Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,6 @@ For information about the governance of the Node.js project, see
**Debadree Chatterjee** <<debadree333@gmail.com>> (he/him)
* [deokjinkim](https://github.com/deokjinkim) -
**Deokjin Kim** <<deokjin81.kim@gmail.com>> (he/him)
* [devnexen](https://github.com/devnexen) -
**David Carlier** <<devnexen@gmail.com>>
* [devsnek](https://github.com/devsnek) -
**Gus Caplan** <<me@gus.host>> (they/them)
* [edsadr](https://github.com/edsadr) -
Expand Down Expand Up @@ -415,8 +413,6 @@ For information about the governance of the Node.js project, see
**Mestery** <<mestery@protonmail.com>> (he/him)
* [mhdawson](https://github.com/mhdawson) -
**Michael Dawson** <<midawson@redhat.com>> (he/him)
* [miladfarca](https://github.com/miladfarca) -
**Milad Fa** <<mfarazma@redhat.com>> (he/him)
* [mildsunrise](https://github.com/mildsunrise) -
**Alba Mendez** <<me@alba.sh>> (she/her)
* [MoLow](https://github.com/MoLow) -
Expand Down Expand Up @@ -525,6 +521,8 @@ For information about the governance of the Node.js project, see
**David Cai** <<davidcai1993@yahoo.com>> (he/him)
* [davisjam](https://github.com/davisjam) -
**Jamie Davis** <<davisjam@vt.edu>> (he/him)
* [devnexen](https://github.com/devnexen) -
**David Carlier** <<devnexen@gmail.com>>
* [digitalinfinity](https://github.com/digitalinfinity) -
**Hitesh Kanwathirtha** <<digitalinfinity@gmail.com>> (he/him)
* [dmabupt](https://github.com/dmabupt) -
Expand Down Expand Up @@ -607,6 +605,8 @@ For information about the governance of the Node.js project, see
**Nicu Micleușanu** <<micnic90@gmail.com>> (he/him)
* [mikeal](https://github.com/mikeal) -
**Mikeal Rogers** <<mikeal.rogers@gmail.com>>
* [miladfarca](https://github.com/miladfarca) -
**Milad Fa** <<mfarazma@redhat.com>> (he/him)
* [misterdjules](https://github.com/misterdjules) -
**Julien Gilli** <<jgilli@netflix.com>>
* [mmarchini](https://github.com/mmarchini) -
Expand Down
2 changes: 1 addition & 1 deletion benchmark/assert/deepequal-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } =
require('assert');

const bench = common.createBenchmark(main, {
n: [5e2],
n: [5e3],
len: [5e2],
strict: [0, 1],
method: [
Expand Down
2 changes: 1 addition & 1 deletion benchmark/assert/deepequal-typedarrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
'Float32Array',
'Uint32Array',
],
n: [5e2],
n: [25000],
strict: [0, 1],
method: [
'deepEqual',
Expand Down
42 changes: 42 additions & 0 deletions benchmark/crypto/oneshot-hash.js
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');
}
45 changes: 45 additions & 0 deletions benchmark/perf_hooks/time-origin.js
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);
}
4 changes: 2 additions & 2 deletions deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* Version number of the ngtcp2 library release.
*/
#define NGTCP2_VERSION "1.2.0"
#define NGTCP2_VERSION "1.3.0"

/**
* @macro
Expand All @@ -46,6 +46,6 @@
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
* becomes 0x010203.
*/
#define NGTCP2_VERSION_NUM 0x010200
#define NGTCP2_VERSION_NUM 0x010300

#endif /* VERSION_H */
2 changes: 1 addition & 1 deletion deps/ngtcp2/ngtcp2/lib/ngtcp2_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ typedef struct ngtcp2_buf {
uint8_t *begin;
/* end points to the one beyond of the last byte of the buffer */
uint8_t *end;
/* pos pointers to the start of data. Typically, this points to the
/* pos points to the start of data. Typically, this points to the
point that next data should be read. Initially, it points to
|begin|. */
uint8_t *pos;
Expand Down
50 changes: 17 additions & 33 deletions deps/ngtcp2/ngtcp2/lib/ngtcp2_cc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
#include <assert.h>
#include <string.h>

#if defined(_MSC_VER)
# include <intrin.h>
#endif

#include "ngtcp2_log.h"
#include "ngtcp2_macro.h"
#include "ngtcp2_mem.h"
Expand Down Expand Up @@ -235,39 +231,27 @@ void ngtcp2_cc_cubic_init(ngtcp2_cc_cubic *cubic, ngtcp2_log *log) {
}

uint64_t ngtcp2_cbrt(uint64_t n) {
int d;
uint64_t a;

if (n == 0) {
return 0;
}

#if defined(_MSC_VER)
{
unsigned long index;
# if defined(_WIN64)
if (_BitScanReverse64(&index, n)) {
d = 61 - index;
} else {
ngtcp2_unreachable();
}
# else /* !defined(_WIN64) */
if (_BitScanReverse(&index, (unsigned int)(n >> 32))) {
d = 31 - index;
} else {
d = 32 + 31 - _BitScanReverse(&index, (unsigned int)n);
size_t s;
uint64_t y = 0;
uint64_t b;

for (s = 63; s > 0; s -= 3) {
y <<= 1;
b = 3 * y * (y + 1) + 1;
if ((n >> s) >= b) {
n -= b << s;
y++;
}
# endif /* !defined(_WIN64) */
}
#else /* !defined(_MSC_VER) */
d = __builtin_clzll(n);
#endif /* !defined(_MSC_VER) */
a = 1ULL << ((64 - d) / 3 + 1);

for (; a * a * a > n;) {
a = (2 * a + n / a / a) / 3;
y <<= 1;
b = 3 * y * (y + 1) + 1;
if (n >= b) {
n -= b;
y++;
}
return a;

return y;
}

/* HyStart++ constants */
Expand Down
63 changes: 33 additions & 30 deletions deps/ngtcp2/ngtcp2/lib/ngtcp2_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3441,12 +3441,22 @@ static ngtcp2_ssize conn_write_pkt(ngtcp2_conn *conn, ngtcp2_pkt_info *pi,
}

switch ((*pfrc)->fr.type) {
case NGTCP2_FRAME_RESET_STREAM:
strm =
ngtcp2_conn_find_stream(conn, (*pfrc)->fr.reset_stream.stream_id);
if (strm == NULL ||
!ngtcp2_strm_require_retransmit_reset_stream(strm)) {
frc = *pfrc;
*pfrc = (*pfrc)->next;
ngtcp2_frame_chain_objalloc_del(frc, &conn->frc_objalloc, conn->mem);
continue;
}
break;
case NGTCP2_FRAME_STOP_SENDING:
strm =
ngtcp2_conn_find_stream(conn, (*pfrc)->fr.stop_sending.stream_id);
if (strm == NULL ||
((strm->flags & NGTCP2_STRM_FLAG_SHUT_RD) &&
ngtcp2_strm_rx_offset(strm) == strm->rx.last_offset)) {
!ngtcp2_strm_require_retransmit_stop_sending(strm)) {
frc = *pfrc;
*pfrc = (*pfrc)->next;
ngtcp2_frame_chain_objalloc_del(frc, &conn->frc_objalloc, conn->mem);
Expand Down Expand Up @@ -3476,10 +3486,8 @@ static ngtcp2_ssize conn_write_pkt(ngtcp2_conn *conn, ngtcp2_pkt_info *pi,
case NGTCP2_FRAME_MAX_STREAM_DATA:
strm = ngtcp2_conn_find_stream(conn,
(*pfrc)->fr.max_stream_data.stream_id);
if (strm == NULL ||
(strm->flags &
(NGTCP2_STRM_FLAG_SHUT_RD | NGTCP2_STRM_FLAG_STOP_SENDING)) ||
(*pfrc)->fr.max_stream_data.max_stream_data < strm->rx.max_offset) {
if (strm == NULL || !ngtcp2_strm_require_retransmit_max_stream_data(
strm, &(*pfrc)->fr.max_stream_data)) {
frc = *pfrc;
*pfrc = (*pfrc)->next;
ngtcp2_frame_chain_objalloc_del(frc, &conn->frc_objalloc, conn->mem);
Expand All @@ -3497,8 +3505,8 @@ static ngtcp2_ssize conn_write_pkt(ngtcp2_conn *conn, ngtcp2_pkt_info *pi,
case NGTCP2_FRAME_STREAM_DATA_BLOCKED:
strm = ngtcp2_conn_find_stream(
conn, (*pfrc)->fr.stream_data_blocked.stream_id);
if (strm == NULL || (strm->flags & NGTCP2_STRM_FLAG_SHUT_WR) ||
(*pfrc)->fr.stream_data_blocked.offset != strm->tx.max_offset) {
if (strm == NULL || !ngtcp2_strm_require_retransmit_stream_data_blocked(
strm, &(*pfrc)->fr.stream_data_blocked)) {
frc = *pfrc;
*pfrc = (*pfrc)->next;
ngtcp2_frame_chain_objalloc_del(frc, &conn->frc_objalloc, conn->mem);
Expand Down Expand Up @@ -7145,7 +7153,7 @@ static int conn_recv_stream(ngtcp2_conn *conn, const ngtcp2_stream *fr) {
return rv;
}
}
} else if (fr->datacnt) {
} else if (fr->datacnt && !(strm->flags & NGTCP2_STRM_FLAG_STOP_SENDING)) {
rv = ngtcp2_strm_recv_reordering(strm, fr->data[0].base, fr->data[0].len,
fr->offset);
if (rv != 0) {
Expand Down Expand Up @@ -7304,27 +7312,20 @@ static int conn_recv_reset_stream(ngtcp2_conn *conn,
}

/* Stream is reset before we create ngtcp2_strm object. */
conn->rx.offset += fr->final_size;
ngtcp2_conn_extend_max_offset(conn, fr->final_size);

rv = conn_call_stream_reset(conn, fr->stream_id, fr->final_size,
fr->app_error_code, NULL);
strm = ngtcp2_objalloc_strm_get(&conn->strm_objalloc);
if (strm == NULL) {
return NGTCP2_ERR_NOMEM;
}
rv = ngtcp2_conn_init_stream(conn, strm, fr->stream_id, NULL);
if (rv != 0) {
ngtcp2_objalloc_strm_release(&conn->strm_objalloc, strm);
return rv;
}

/* There will be no activity in this stream because we got
RESET_STREAM and don't write stream data any further. This
effectively allows another new stream for peer. */
if (bidi) {
handle_max_remote_streams_extension(&conn->remote.bidi.unsent_max_streams,
1);
} else {
handle_max_remote_streams_extension(&conn->remote.uni.unsent_max_streams,
1);
rv = conn_call_stream_open(conn, strm);
if (rv != 0) {
return rv;
}

return 0;
}

if ((strm->flags & NGTCP2_STRM_FLAG_SHUT_RD)) {
Expand Down Expand Up @@ -7461,15 +7462,16 @@ static int conn_recv_stop_sending(ngtcp2_conn *conn,
been acknowledged. */
if (!ngtcp2_strm_is_all_tx_data_fin_acked(strm) &&
!(strm->flags & NGTCP2_STRM_FLAG_RESET_STREAM)) {
strm->flags |= NGTCP2_STRM_FLAG_RESET_STREAM;

rv = conn_reset_stream(conn, strm, fr->app_error_code);
if (rv != 0) {
return rv;
}
}

strm->flags |= NGTCP2_STRM_FLAG_SHUT_WR |
NGTCP2_STRM_FLAG_STOP_SENDING_RECVED |
NGTCP2_STRM_FLAG_RESET_STREAM;
strm->flags |=
NGTCP2_STRM_FLAG_SHUT_WR | NGTCP2_STRM_FLAG_STOP_SENDING_RECVED;

ngtcp2_strm_streamfrq_clear(strm);

Expand Down Expand Up @@ -12533,14 +12535,15 @@ static int conn_shutdown_stream_read(ngtcp2_conn *conn, ngtcp2_strm *strm,

/* Extend connection flow control window for the amount of data
which are not passed to application. */
if (!(strm->flags & (NGTCP2_STRM_FLAG_STOP_SENDING |
NGTCP2_STRM_FLAG_RESET_STREAM_RECVED))) {
if (!(strm->flags & NGTCP2_STRM_FLAG_RESET_STREAM_RECVED)) {
ngtcp2_conn_extend_max_offset(conn, strm->rx.last_offset -
ngtcp2_strm_rx_offset(strm));
}

strm->flags |= NGTCP2_STRM_FLAG_STOP_SENDING;

ngtcp2_strm_discard_reordered_data(strm);

return conn_stop_sending(conn, strm, app_error_code);
}

Expand Down
Loading