kuchiki-rs / kuchiki

(朽木) HTML/XML tree manipulation library for Rust
MIT License
470 stars 54 forks source link

NodeData is unnecessarily large, bloating the size of all Nodes #73

Closed jdm closed 1 year ago

jdm commented 4 years ago

mem::size_of::<Node>() reports 120 bytes, and mem::size_of::<NodeData>() makes up 80 of those bytes. If we box most of the variants of the NodeData enum, this can shrink to 56 and 16 bytes respectively.

jdm commented 4 years ago

Unfortunately in testcase from https://github.com/servo/html5ever/issues/420#issuecomment-644236225, this only reduces the memory usage by ~450mb. Not nothing, but need to keep investigating where all the memory is going.

SimonSapin commented 4 years ago

Some discussion in https://github.com/kuchiki-rs/kuchiki/pull/74#issuecomment-653157508

SimonSapin commented 1 year ago

I will soon archive this repository and make it read-only, so this issue will not be addressed: https://github.com/kuchiki-rs/kuchiki#archived