Skip to content

Optimise annotation expansion for mc_amqp#15743

Merged
michaelklishin merged 1 commit intomainfrom
mc-ampq-modify-annotations
Mar 18, 2026
Merged

Optimise annotation expansion for mc_amqp#15743
michaelklishin merged 1 commit intomainfrom
mc-ampq-modify-annotations

Conversation

@kjnilsson
Copy link
Copy Markdown
Contributor

No description provided.

@kjnilsson kjnilsson requested a review from Copilot March 17, 2026 10:35
@kjnilsson kjnilsson changed the title QIP: Optimise annotation expansion for mc_amqp WIP: Optimise annotation expansion for mc_amqp Mar 17, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Optimizes how mc_amqp expands mc:annotations() into AMQP 1.0 message annotations during protocol_state/2, aiming to reduce per-annotation list scans.

Changes:

  • Prefilters existing message annotations (MA0) before folding in new annotations from Anns.
  • Replaces lists:keystore/4-based upsert with O(1) consing for newly added annotations.
  • Leaves the previous upsert helper and call sites commented out.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deps/rabbit/src/mc_amqp.erl Outdated
Comment thread deps/rabbit/src/mc_amqp.erl Outdated
Comment thread deps/rabbit/src/mc_amqp.erl Outdated
@kjnilsson kjnilsson force-pushed the mc-ampq-modify-annotations branch from 56ea0c3 to e550aeb Compare March 17, 2026 10:46
@kjnilsson kjnilsson changed the title WIP: Optimise annotation expansion for mc_amqp Optimise annotation expansion for mc_amqp Mar 18, 2026
@kjnilsson kjnilsson requested a review from ansd March 18, 2026 09:20
@kjnilsson kjnilsson force-pushed the mc-ampq-modify-annotations branch from 1e05064 to e550aeb Compare March 18, 2026 17:13
@kjnilsson kjnilsson marked this pull request as ready for review March 18, 2026 17:15
@michaelklishin
Copy link
Copy Markdown
Collaborator

There are some test gaps but they are not new, so can be addressed with a follow-up PR when the pre-4.3.0 release dust settles.

@michaelklishin michaelklishin added this to the 4.4.0 milestone Mar 18, 2026
@michaelklishin michaelklishin merged commit 2ea6120 into main Mar 18, 2026
536 of 537 checks passed
@michaelklishin michaelklishin deleted the mc-ampq-modify-annotations branch March 18, 2026 21:42
michaelklishin added a commit that referenced this pull request Mar 18, 2026
Optimise annotation expansion for mc_amqp (backport #15743)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants