Skip to content

remove slow textencoder branch#6303

Draft
anonrig wants to merge 1 commit intomainfrom
yagiz/remove-slow-text-encoder
Draft

remove slow textencoder branch#6303
anonrig wants to merge 1 commit intomainfrom
yagiz/remove-slow-text-encoder

Conversation

@anonrig
Copy link
Copy Markdown
Contributor

@anonrig anonrig commented Mar 11, 2026

[DO NOT MERGE]

Blocked until fast-text-encoder autogate is rolled out.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Mar 11, 2026

The change is straightforward — it removes the slow fallback branches guarded by the ENABLE_FAST_TEXTENCODER autogate in both encode() and encodeInto(), making the fast simdutf-based implementation the only code path. The #include <workerd/util/autogate.h> is also correctly removed since it's no longer needed.

One issue I notice: after this PR, the ENABLE_FAST_TEXTENCODER autogate key definition in autogate.h and autogate.c++ becomes dead code — it has no remaining consumers. This should be cleaned up in this PR or a follow-up.

The PR description says "Blocked until fast-text-encoder autogate is rolled out", which is the correct approach — the autogate must be fully rolled out before removing the fallback.

LGTM

github run

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 11, 2026

Merging this PR will improve performance by ×8.7

⚡ 16 improved benchmarks
✅ 54 untouched benchmarks
⏩ 129 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
Encode_ASCII_1024[TextEncoder][0/0/1024] 3.7 ms 3.2 ms +15.65%
EncodeInto_TwoByte_256[TextEncoder][1/2/256] 5.3 ms 2.8 ms +88.42%
EncodeInto_TwoByte_8192[TextEncoder][1/2/8192] 96.6 ms 11.1 ms ×8.7
Encode_ASCII_256[TextEncoder][0/0/256] 3.1 ms 2.6 ms +20.57%
Encode_OneByte_256[TextEncoder][0/1/256] 5.2 ms 3 ms +74.33%
Encode_ASCII_8192[TextEncoder][0/0/8192] 13.5 ms 8.6 ms +57.26%
Encode_OneByte_1024[TextEncoder][0/1/1024] 12 ms 4.5 ms ×2.7
Encode_OneByte_8192[TextEncoder][0/1/8192] 84.7 ms 18.5 ms ×4.6
Encode_TwoByte_1024[TextEncoder][0/2/1024] 16.4 ms 5.1 ms ×3.2
Encode_TwoByte_8192[TextEncoder][0/2/8192] 119.5 ms 23.3 ms ×5.1
Encode_ASCII_32[TextEncoder][0/0/32] 3.2 ms 2.4 ms +32.57%
Encode_TwoByte_256[TextEncoder][0/2/256] 6.5 ms 3.3 ms +97.22%
EncodeInto_TwoByte_1024[TextEncoder][1/2/1024] 14.1 ms 3.5 ms ×4
EncodeInto_OneByte_1024[TextEncoder][1/1/1024] 10.4 ms 3.4 ms ×3
EncodeInto_OneByte_8192[TextEncoder][1/1/8192] 66.5 ms 9.6 ms ×7
EncodeInto_OneByte_256[TextEncoder][1/1/256] 4.4 ms 2.8 ms +57.09%

Comparing yagiz/remove-slow-text-encoder (82f0c46) with main (755795d)

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@jasnell
Copy link
Copy Markdown
Collaborator

jasnell commented Mar 25, 2026

@anonrig ... what's the status on this one?

@anonrig
Copy link
Copy Markdown
Contributor Author

anonrig commented Mar 25, 2026

@anonrig ... what's the status on this one?

Autogate not yet released.

@jasnell
Copy link
Copy Markdown
Collaborator

jasnell commented Mar 27, 2026

Are you planning on releasing the autogate soon? Is there a reason to keep waiting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants