Files
zed/crates/markdown/src/html.rs
T
Kirill Bulatov 20fa2fa809 Reduce LLVM IR bloat one last time (#63882)
I think this is the final attempt of mine to do anything about the
binary size, as those fixes become relatively intricate and I like them
less and less.

Each commit has its own improvement stats and mainly reduce generic-code
duplication through shared non-generic helpers and `#[inline(never)]`
boundaries.

Total reduction stats:

With sccache disabled, `cargo clean` and `cargo build --release -p zed`:
Before: zed binary 396716472 bytes
After: zed binary 359416504 bytes (-9.40%, -37.29MB)

Release Notes:

- N/A

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-09-07 15:18:49 +00:00

15 lines
387 B
Rust

mod html_minifier;
pub(crate) mod html_parser;
mod html_rendering;
use html5ever::{ParseOpts, parse_document, tendril::TendrilSink};
use markup5ever_rcdom::RcDom;
use std::io::{self, Read};
#[inline(never)]
fn parse_html(mut reader: &mut dyn Read) -> io::Result<RcDom> {
parse_document(RcDom::default(), ParseOpts::default())
.from_utf8()
.read_from(&mut reader)
}