Skip to content

Improve memory density of RowBuffer #388

Description

@Ostrzyciel

RowBuffer is currently one of the most frequently accessed structures, and, unfortunately, it is pretty memory-sparse, which hurts performance.

We could make a really crazy thing where the underlying storage of a RowBuffer were just two arrays, of row type (byte[]) and the content (ProtoMessage[]). While the memory layout would not be perfect (type and message pointer will not be next to each other), we would eliminate 1. array of pointers to rows (Nx4B) 2. object headers of RdfStreamRow

  • original: 4 * n [row array] + (12 [OH] + 4 [pointer] + 1 [byte] + 7 [alignment]) * n = 28n
  • proposed: 4 * n [pointers] + 1 * n [bytes] = 5n

where n is the number of rows in the buffer. I'm not counting the overhead for the array header (it's constant).

This would not do anything if we were using allocation-free parsing (#371), but could help a tiny bit with serialization.

Because of that, I would really prioritize #371 first, and then investigate this one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions