Uh oh!
There was an error while loading. Please reload this page.
src: add fast path to TextEncoder.encodeInto - #45701
Conversation
Original commit message: [fastcall] Implement support for onebyte string arguments This CL adds one byte string specialization support for fast API call arguments. It introduces a kOneByteString variant to CTypeInfo. We see a ~6x improvement in Deno's TextEncoder#encode microbenchmark. Rendered results: https://divy-v8-patches.deno.dev/ Bug: chromium:1052746 Change-Id: I47c3a9e101cd18ddc6ad58f627db3a34231b60f7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4036884 Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Maya Lekova <mslekova@chromium.org> Commit-Queue: Maya Lekova <mslekova@chromium.org> Cr-Commit-Position: refs/heads/main@{#84552} Refs: v8/v8@bc831f8
nodejs-github-bot
commented
Dec 1, 2022
Review requested:
|
nodejs-github-bot
commented
Dec 1, 2022
nodejs-github-bot
commented
Dec 1, 2022
nodejs-github-bot
commented
Dec 1, 2022
targos
left a comment
There was a problem hiding this comment.
I would be more inclined to accept this if the new capabilities were used by a subsequent commit. Otherwise the change doesn't bring anything to Node.js.
anonrig
commented
Dec 1, 2022
@targos Should I include my changes depending on this to this particular pull request, and add |
targos
commented
Dec 1, 2022
That would be fine, yes. |
ShogunPanda
commented
Dec 1, 2022
These changes look fine to me. I'm approving, but I agree on what @targos said. |
nodejs-github-bot
commented
Dec 2, 2022
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Nit: we already have so many files dealing with encodings, does this really need to be a new one (instead of, e.g., staying in node_buffer or maybe string_bytes)? And if so, is this the encoding file?
There was a problem hiding this comment.
I don’t have any specific thoughts on this. I’ll try to move the encode utf8 to the node_encoding once this is implementation improves the existing benchmark.
There was a problem hiding this comment.
I'm still not sure why this is a new file when it only covers a tiny part of all encoding-related routines.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Dec 6, 2022
nodejs-github-bot
commented
Dec 6, 2022
anonrig
commented
Dec 6, 2022
@tniessen Can you review this, since in your last review, you |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Anna Henningsen <anna@addaleax.net>
anonrig
commented
Dec 8, 2022
@targos If it's ok, I recommend creating a pull request for merging the v8 cherry-pick, and continue this performance experiment in this pull request. There are several new areas (wasm for example) that can leverage this cherry-pick. |
| // For loop is required to trigger the fast path for encodeInto | ||
| // Since v8 fast path is only triggered when v8 optimization starts. |
There was a problem hiding this comment.
There is no guarantee that V8 would take the fast path.
| // For loop is required to trigger the fast path for encodeInto | |
| // Since v8 fast path is only triggered when v8 optimization starts. | |
| // Using a loop increases the chances of triggering the fast path for encodeInto | |
| // because V8 heuristically optimizes based on information gathered at runtime. |
There was a problem hiding this comment.
I'm still not sure why this is a new file when it only covers a tiny part of all encoding-related routines.
aduh95
commented
Dec 10, 2022
There are git conflicts, no Jenkins CI run on the last commit, and two collaborators blocking the PR, removing
author ready |
anonrig
commented
Dec 10, 2022
Thanks, @aduh95. Since other pull requests are merged, I’ll update this pull request only focusing on encodeInto. |
Original commit message:
Refs: v8/v8@bc831f8
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1259/