summaryrefslogtreecommitdiff
path: root/ext/net/01_net.js
AgeCommit message (Collapse)Author
2024-10-17fix(net): don't try to set nodelay on upgrade streams (#26342)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26341. We try to call `op_set_nodelay` on an `UpgradeStream`, which doesn't support that operation.
2024-09-11BREAKING(net): remove `Deno.[Tls]Listener.prototype.rid` (#25556)Asher Gomez
Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-06BREAKING(net): remove `Deno.{Conn,TlsConn,TcpConn,UnixConn}.prototype.rid` ↵Asher Gomez
(#25446) Towards #22079 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-06fix(runtime): use more null proto objects again (#25040)Kenta Moriuchi
proceed with #23921 This PR is a preparation for https://github.com/denoland/deno_lint/pull/1307 --------- Signed-off-by: Kenta Moriuchi <moriken@kimamass.com> Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-08-31chore(net): remove `Deno.shutdown()` (#25253)Asher Gomez
2024-08-20fix(ext/net): validate port in Deno.{connect,serve,listen} (#24399)seb
Co-authored-by: Will Leach <4619280+melbourne2991@users.noreply.github.com> Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: David Sherret <dsherret@gmail.com>
2024-08-14feat(serve): Opt-in parallelism for `deno serve` (#24920)Nathan Whitaker
Adds a `parallel` flag to `deno serve`. When present, we spawn multiple workers to parallelize serving requests. ```bash deno serve --parallel main.ts ``` Currently on linux we use `SO_REUSEPORT` and rely on the fact that the kernel will distribute connections in a round-robin manner. On mac and windows, we sort of emulate this by cloning the underlying file descriptor and passing a handle to each worker. The connections will not be guaranteed to be fairly distributed (and in practice almost certainly won't be), but the distribution is still spread enough to provide a significant performance increase. --- (Run on an Macbook Pro with an M3 Max, serving `deno.com` baseline:: ``` ❯ wrk -d 30s -c 125 --latency http://127.0.0.1:8000 Running 30s test @ http://127.0.0.1:8000 2 threads and 125 connections Thread Stats Avg Stdev Max +/- Stdev Latency 239.78ms 13.56ms 330.54ms 79.12% Req/Sec 258.58 35.56 360.00 70.64% Latency Distribution 50% 236.72ms 75% 248.46ms 90% 256.84ms 99% 268.23ms 15458 requests in 30.02s, 2.47GB read Requests/sec: 514.89 Transfer/sec: 84.33MB ``` this PR (`with --parallel` flag) ``` ❯ wrk -d 30s -c 125 --latency http://127.0.0.1:8000 Running 30s test @ http://127.0.0.1:8000 2 threads and 125 connections Thread Stats Avg Stdev Max +/- Stdev Latency 117.40ms 142.84ms 590.45ms 79.07% Req/Sec 1.33k 175.19 1.77k 69.00% Latency Distribution 50% 22.34ms 75% 223.67ms 90% 357.32ms 99% 460.50ms 79636 requests in 30.07s, 12.74GB read Requests/sec: 2647.96 Transfer/sec: 433.71MB ```
2024-07-10fix(net): set correct max size for Datagram (#21611)Andrew Johnston
2024-04-08FUTURE(ext/net): remove ↵Asher Gomez
`Deno.(Conn|TlsConn|Listener|TlsListener|UnixConn).prototype.rid` (#23219) Towards #23089 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-03-19chore: rename internal `Datagram` class to `DatagramConn` (#22474)Asher Gomez
As having mismatched public and private class names may be confusing, without good reason, to those unfamiliar with the codebase.
2024-02-19BREAKING(net/unstable): remove `Deno.DatagramConn.rid` (#22475)Asher Gomez
As part of ongoing efforts to remove `rid` properties from the public API. Note: this property is undocumented.
2024-02-13chore: cleanup obsolete `Datagram` export (#22078)Asher Gomez
This isn't used anywhere outside the originating file.
2024-02-07chore: upgrade deno_core to 0.259.0 (#22311)Bartek Iwańczuk
This update brings number of ops available to user code down to 45.
2024-01-29refactor: Use virtul ops module (#22175)Bartek Iwańczuk
Follow up to #22157. This leaves us with 4 usages of `ensureFastOps()` in `deno` itself. There's also about 150 usages of `Deno.core.ops.<op_name>` left as well.
2024-01-26refactor: migrate extensions to virtual ops module (#22135)Bartek Iwańczuk
First pass of migrating away from `Deno.core.ensureFastOps()`. A few "tricky" ones have been left for a follow up.
2024-01-26refactor: make 'rid' properties non-enumerable (#22137)Bartek Iwańczuk
Now these props will not show up when inspecting objects in console.
2024-01-26chore: upgrade deno_core (#22124)Bartek Iwańczuk
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-01-25fix: don't use public rid accessors in internal APIs (#22091)Bartek Iwańczuk
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-24feat: deprecate `Deno.{Conn,TcpConn,TlsConn,UnixConn}.rid` (#22077)Asher Gomez
For removal in Deno v2. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-24feat: deprecate `Deno.Listener.rid` (#22076)Asher Gomez
For removal in Deno v2.
2024-01-10refactor: use `core.ensureFastOps()` (#21888)Kenta Moriuchi
2024-01-04fix(ext/node): UdpSocket ref and unref (#21777)Divy Srivastava
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-27perf: remove opAsync (#21690)Matt Mastracci
`opAsync` requires a lookup by name on each async call. This is a mechanical translation of all opAsync calls to ensureFastOps. The `opAsync` API on Deno.core will be removed at a later time.
2023-12-07refactor: pull 'core', 'internals', 'primordials' from ES module (#21462)Bartek Iwańczuk
This commit refactors how we access "core", "internals" and "primordials" objects coming from `deno_core`, in our internal JavaScript code. Instead of capturing them from "globalThis.__bootstrap" namespace, we import them from recently added "ext:core/mod.js" file.
2023-11-09perf: remove knowledge of promise IDs from deno (#21132)Matt Mastracci
We can move all promise ID knowledge to deno_core, allowing us to better experiment with promise implementation in deno_core. `{un,}refOpPromise(promise)` is equivalent to `{un,}refOp(promise[promiseIdSymbol])`
2023-11-01feat: disposable Deno resources (#20845)Luca Casonato
This commit implements Symbol.dispose and Symbol.asyncDispose for the relevant resources. Closes #20839 --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-10-04feat(unstable): add unix domain socket support to Deno.serve (#20759)Yoshiya Hinosawa
2023-07-25fix(ext/net): fix string port number handling in listen (#19921)Yoshiya Hinosawa
While string `port` is not allowed in typing, it seems we used to support that and now it's broken. ref: https://github.com/denoland/deno/issues/10064#issuecomment-1637427260 This PR restores the support of string port number in `listen` and `listenTls`
2023-05-01fix(core): Use primordials for methods (#18839)Kenta Moriuchi
I would like to get this change into Deno before merging https://github.com/denoland/deno_lint/pull/1152
2023-03-20feat(ext/net): Add multicasting APIs to DatagramConn (#10706) (#17811)Sam Gwilym
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-02-11feat: add signal option to Deno.resolveDns (#17384)Leo Kettmeir
Closes #14406
2023-02-07 refactor: remove prefix from include_js_files & use extension name (#17683)Leo Kettmeir
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-20feat: Stabilize Deno.Listener.ref/unref (#17477)Bartek Iwańczuk
2023-01-16chore: update dlint to v0.37.0 for GitHub Actions (#17295)Kenta Moriuchi
Updated third_party dlint to v0.37.0 for GitHub Actions. This PR includes following changes: * fix(prefer-primordials): Stop using array pattern assignments * fix(prefer-primordials): Stop using global intrinsics except for `SharedArrayBuffer` * feat(guard-for-in): Apply new guard-for-in rule
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-28feat(unstable): Add Deno.Conn.ref()/unref() (#17170)Bartek Iwańczuk
This commit adds "Deno.Conn.ref()" and "Deno.Conn.unref()" methods. These methods can be used to make connection block or not block the event loop from finishing. Refing/unrefing only influences "read" operations - ie. scheduling writes to a connection _do_ keep event loop alive. Required for https://github.com/denoland/deno/issues/16710
2022-12-14feat: Stabilize Deno.TcpConn.setNoDelay() and Deno.TcpConn.setKeepAlive() ↵Bartek Iwańczuk
(#17003) This commit stabilizes following APIs: - `Deno.TcpConn.setNoDelay()` - `Deno.TcpConn.setKeepAlive()`
2022-11-10feat: don't require --unstable flag for npm programs (#16520)Bartek Iwańczuk
This PR adds copies of several unstable APIs that are available in "Deno[Deno.internal].nodeUnstable" namespace. These copies do not perform unstable check (ie. don't require "--unstable" flag to be present). Otherwise they work exactly the same, including permission checks. These APIs are not meant to be used by users directly and can change at any time. Copies of following APIs are available in that namespace: - Deno.spawnChild - Deno.spawn - Deno.spawnSync - Deno.serve - Deno.upgradeHttpRaw - Deno.listenDatagram
2022-10-26feat(ext/net): reusePort for TCP on Linux (#16398)Luca Casonato
2022-10-25Revert "Revert "refactor(ext/net): clean up variadic network ops (#16… ↵Bartek Iwańczuk
(#16422) …392)" (#16417)" This reverts commit 8e3f825c921b38141afa7a69a0664881c5c94461.
2022-10-25Revert "refactor(ext/net): clean up variadic network ops (#16392)" (#16417)Bartek Iwańczuk
Should fix https://github.com/denoland/deno_std/issues/2807
2022-10-24refactor(ext/net): clean up variadic network ops (#16392)Luca Casonato
Previously `op_net_listen`, `op_net_accept`, and various other ops in ext/net where variadic on the transport. This created a lot of code bloat. This commit updates the code to instead have separate ops for each transport.
2022-10-10feat(core): add Deno.core.writeAll(rid, chunk) (#16228)Luca Casonato
This commit adds a new op_write_all to core that allows writing an entire chunk in a single async op call. Internally this calls `Resource::write_all`. The `writableStreamForRid` has been moved to `06_streams.js` now, and uses this new op. Various other code paths now also use this new op. Closes #16227
2022-09-30fix(runtime): no FastStream for unrefable streams (#16095)Luca Casonato
2022-08-11perf(ops): Monomorphic sync op calls (#15337)Aapo Alasuutari
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params). Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple: ``` opSync("op_foo", param1, param2); // -> turns to ops.op_foo(param1, param2); ``` This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path. Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-04-22Reland "perf(http): optimize ReadableStreams backed by a resource" (#14346)Divy Srivastava
2022-04-21Revert various PRs related to "ext/http" (#14339)Bartek Iwańczuk
* Revert "feat(ext/http): stream auto resp body compression (#14325)" * Revert "core: introduce `resource.read_return` (#14331)" * Revert "perf(http): optimize `ReadableStream`s backed by a resource (#14284)"