Skip to content

Conversation

@michaelklishin
Copy link
Collaborator

@michaelklishin michaelklishin commented Nov 3, 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

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.
@michaelklishin michaelklishin added this to the 4.3.0 milestone Nov 3, 2025
@michaelklishin michaelklishin merged commit a82d9ab into main Nov 4, 2025
574 of 575 checks passed
@michaelklishin michaelklishin deleted the mk-swap-queue-for-lqueue branch November 4, 2025 00:24
michaelklishin added a commit that referenced this pull request Nov 4, 2025
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.

2 participants