Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming handlers #229

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

kornelski
Copy link
Contributor

@kornelski kornelski commented Oct 28, 2024

Basis for cloudflare/workerd#2758

  • to_bytes turned into fallible into_bytes to guarantee that the content handlers are called only once, and to report encoding errors in the future.
  • into_bytes using self became more performance-sensitive to the size of the token structs, so I've made Mutations allocated lazily, assuming that majority of nodes aren't mutated.
  • there's a fast path that avoids using encoding_rs::Encoder when the output is UTF-8.
  • This PR omits support for incomplete UTF-8 chunks, I'll add that after this is merged.

Cargo.toml Outdated Show resolved Hide resolved
src/rewritable_units/mutations.rs Outdated Show resolved Hide resolved
@kornelski kornelski force-pushed the streaming-handlers branch 2 times, most recently from 8e6848b to 7eff224 Compare November 1, 2024 16:33
src/rewritable_units/text_encoder.rs Outdated Show resolved Hide resolved
src/rewritable_units/text_encoder.rs Outdated Show resolved Hide resolved
src/rewritable_units/text_encoder.rs Outdated Show resolved Hide resolved
@kornelski kornelski force-pushed the streaming-handlers branch 4 times, most recently from a6bb591 to 2408c60 Compare November 4, 2024 17:54
@kornelski kornelski force-pushed the streaming-handlers branch 3 times, most recently from 85cb96a to 212155d Compare November 6, 2024 17:47
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.

3 participants