Skip to content

Commit

Permalink
Update html-rewriter.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Jan 13, 2025
1 parent 051a606 commit 22ebeae
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions docs/api/html-rewriter.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,22 +331,6 @@ try {
}
```

## Performance

Bun's HTMLRewriter is built on [lol-html](https://github.com/cloudflare/lol-html), a low-level HTML rewriting library written in Rust. This provides excellent performance characteristics:

- Streaming processing of HTML content
- Minimal memory overhead
- No DOM construction unless necessary
- Efficient CSS selector matching
- Configurable parsing buffer sizes (defaults to max(input_size, 1024) bytes)

The implementation uses efficient memory management and streaming techniques:

- Content is processed in chunks
- Backpressure is handled automatically
- Memory is released as soon as possible
- Large files are handled efficiently
- Automatic handling of compressed content (gzip)
## See also

You can also read the [Cloudflare documentation](https://developers.cloudflare.com/workers/runtime-apis/html-rewriter/), which this API is intended to be compatible with.

0 comments on commit 22ebeae

Please sign in to comment.