1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
denoland-deno/ext/node/polyfills/internal_binding
Divy Srivastava c7153838ec
fix(ext/node): implement TCP.setNoDelay (#26263)
Fixes https://github.com/denoland/deno/issues/26177

The significant delay was caused by Nagel's algorithm + delayed ACKs in
Linux kernels. Here's the [kernel
patch](https://lwn.net/Articles/502585/) which added 40ms
`tcp_default_delack_min`

```
$ deno run -A pg-bench.mjs # main
Tue Oct 15 2024 12:27:22 GMT+0530 (India Standard Time): 42ms

$ target/release/deno run -A pg-bench.mjs # this patch
Tue Oct 15 2024 12:28:02 GMT+0530 (India Standard Time): 1ms
```

```js
import { Buffer } from "node:buffer";

import pg from 'pg'
const { Client } = pg
const client = new Client({
    connectionString: 'postgresql://postgres:postgres@127.0.0.1:5432/postgres'
})
await client.connect()

async function fetch() {
    const startPerf = performance.now();
    const res = await client.query(`select
        $1::int as int,
        $2 as string,
        $3::timestamp with time zone as timestamp,
        $4 as null,
        $5::bool as boolean,
        $6::bytea as bytea,
        $7::jsonb as json
      `, [
        1337,
        'wat',
        new Date().toISOString(),
        null,
        false,
        Buffer.from('awesome'),
        JSON.stringify([{ some: 'json' }, { array: 'object' }])
    ])
    console.log(`${new Date()}: ${Math.round(performance.now() - startPerf)}ms`)
}

for(;;) await fetch();
```
2024-10-15 14:47:12 +05:30
..
_libuv_winerror.ts refactor: migrate 'ext/node' extension to virtual ops module (#22157) 2024-01-29 14:58:08 +01:00
_listen.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
_node.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
_timingSafeEqual.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
_utils.ts Revert "perf(ext/node): improve Buffer from string performance" (#24851) 2024-08-02 16:23:21 +02:00
ares.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
async_wrap.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
buffer.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
cares_wrap.ts fix(BREAKING): make dns record types have consistent naming (#25357) 2024-09-02 11:19:08 +00:00
connection_wrap.ts chore: update deno_lint for CI (#21802) 2024-01-05 15:03:06 +00:00
constants.ts refactor: Use virtul ops module (#22175) 2024-01-29 22:02:26 +01:00
crypto.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
handle_wrap.ts docs: fix typos (#24820) 2024-08-02 13:26:54 +02:00
mod.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
node_file.ts BREAKING(fs): remove Deno.seek[Sync]() (#25449) 2024-09-05 20:37:28 +10:00
node_options.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
pipe_wrap.ts feat(cli): use NotCapable error for permission errors (#25431) 2024-09-10 11:12:24 -07:00
README.md feat(ext/node): embed std/node into the snapshot (#17724) 2023-02-14 17:38:45 +01:00
stream_wrap.ts fix(ext/node): avoid showing UNKNOWN error from TCP handle (#25550) 2024-09-11 19:19:02 +09:00
string_decoder.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
symbols.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
tcp_wrap.ts fix(ext/node): implement TCP.setNoDelay (#26263) 2024-10-15 14:47:12 +05:30
types.ts fix: strict type check for cross realms (#21669) 2024-01-04 09:42:38 +05:30
udp_wrap.ts feat(cli): use NotCapable error for permission errors (#25431) 2024-09-10 11:12:24 -07:00
util.ts refactor: migrate 'ext/node' extension to virtual ops module (#22157) 2024-01-29 14:58:08 +01:00
uv.ts fix: android support (#19437) 2024-01-10 06:04:14 -07:00

Internal Bindings

The modules in this directory implement (simulate) C++ bindings implemented in the ./src/ directory of the Node.js repository.

These bindings are created in the Node.js source code by using NODE_MODULE_CONTEXT_AWARE_INTERNAL.

Please refer to https://github.com/nodejs/node/blob/master/src/README.md for further information.