Skip to content

Conversation

yaauie
Copy link
Member

@yaauie yaauie commented Jul 14, 2025

What does this PR do?

Avoids deserialization cost of events passing through the PQ when memory pressure is absent, by maintaining a list of soft-references to the events added to each PQ page. When constructing batches during reads, we use a new internal intermediate type BoxedQueueable, each of which holds either a strong-reference to a Queueable or the byte[] and deserializer necessary to construct it. Deserialization, if any, still occurs outside of the Queue locking mechanism.

Why is it important/What is the impact to the user?

Reduces the overhead of reading from a PQ when a pipeline is staying caught up with the workload.

Status

This is a proof-of-concept; actual implementation may change significantly. As a proof-of-concept spike, I did not take the time to arrange it into bite-size changes.

Avoids deserialization cost by holding a list of soft-references on each PQ page
to the actual event objects from the page, allowing GC to collect the referenced
objects in the event of memory pressure.

While forming batches during reads, elements are returned from the cache until
one is not present, at which point we fall through to reading the bytes from
the memory-mapped file, returning an intermediate `BoxedQueueable` in either
case. The elements are then unboxed outside of the queue locking mechanism.
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

mergify bot commented Jul 14, 2025

This pull request does not have a backport label. Could you fix it @yaauie? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

Copy link

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants