mirror of
https://github.com/denoland/deno.git
synced 2024-12-27 17:49:08 -05:00
c7153838ec
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(); ``` |
||
---|---|---|
.. | ||
_libuv_winerror.ts | ||
_listen.ts | ||
_node.ts | ||
_timingSafeEqual.ts | ||
_utils.ts | ||
ares.ts | ||
async_wrap.ts | ||
buffer.ts | ||
cares_wrap.ts | ||
connection_wrap.ts | ||
constants.ts | ||
crypto.ts | ||
handle_wrap.ts | ||
mod.ts | ||
node_file.ts | ||
node_options.ts | ||
pipe_wrap.ts | ||
README.md | ||
stream_wrap.ts | ||
string_decoder.ts | ||
symbols.ts | ||
tcp_wrap.ts | ||
types.ts | ||
udp_wrap.ts | ||
util.ts | ||
uv.ts |
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.