blink/dom: Make CharacterData use ParkableStrings for large strings.
Some DOM nodes are large (for instance, inline scripts), and their data is kept in memory at all time. In the case of inline scripts, the data is owned by both the DOM node and the script object. This prevents any inline script source code from getting compressed. Add a way to store such nodes as ParkableStrings. On facebook.com/obama, this allows to compress ~1.9MB more data, and yields sizable memory savings (~1.5MB, see linked bug). The cost is to add a bool and a ParkableString member to each CharacterData node, that is ~2 * sizeof(void*). There is no runtime cost (aside from a single branch) if compression is not enabled, of if the data is small. Bug: 929110 Change-Id: Icd70b108f5ebbd714f373ba362cb708cbb9aa52a Reviewed-on: https://chromium-review.googlesource.com/c/1459548 Commit-Queue: Benoit L <lizeb@chromium.org> Reviewed-by:Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#630719}
Showing
Please register or sign in to comment