[PATCH] D124422: [Serialization] Improve encoding of small SourceRanges.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 02:32:15 PDT 2022

ilya-biryukov added a comment.

Yeah, that sounds promising. Various source locations inside the same nodes are probably very close. Probably even across nodes.
If we are willing to take on a bit more complexity, we could probably get even bigger wins by storing all source locations in a single array  having indices into that array in the actual positions where we need the source locations. That way we can have:

- get the benefits of delta-encoding in the source locations array, probably even across nodes,
- probably still get quite good encoding for indices inside this array inside the actual AST nodes. Will definitely get those if we delta-encode the indices inside the same node.

I suspect there are requirements that will force us to store the array in chunks and allow searching for a particular chunk.

However, that's really adding quite a bit of complexity and I'm not sure preamble sizes are such a big deal outside our environment. E.g. even 10% savings are borderline for that kind of complexity.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list