Skip to content

Conversation

@mergify
Copy link

@mergify mergify bot commented Nov 4, 2025

This is a follow-up to #14873.

The queue module is not aware of the queue
length, which means its len/1 function
is O(n) [1] while with lqueue it is O(1).

We rely on queue:len/1 for a shovel metric,
so why not use a more efficient drop-in replacement
our team has developed in 2011.

  1. https://github.com/erlang/otp/blob/maint-27/lib/stdlib/src/queue.erl#L39-L46
    This is an automatic backport of pull request Shovel: swap queue for lqueue #14890 done by Mergify.

the `queue' module is not aware of the queue
length, which means its `len/1` function is
O(n) while with `lqueue' it is O(1).

We rely on `queue:len/1' for a shovel metric,
so why not use a more efficient drop-in replacement
our team has developed in 2011.

(cherry picked from commit 7aa7433)
@michaelklishin michaelklishin added this to the 4.2.1 milestone Nov 4, 2025
@michaelklishin michaelklishin merged commit e174ab0 into v4.2.x Nov 4, 2025
573 of 575 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-14890 branch November 4, 2025 01:52
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