Skip to content

Conversation

@Mellich-2
Copy link

Hi,

In the current version 0.18.20 of DataStructures, using dequeue! leads to runtime dispatches affecting performance.
The error can be fixed by declaring a used alias as const.

Small example reproducing the error:

using JET
using Pkg
Pkg.activate(".")
using DataStructures
q = Queue{Int}()
enqueue!(q, 1)
@report_opt dequeue!(q)

results in

´´´
═════ 1 possible error found ═════
┌ dequeue!(s::Queue{Int64}) @ DataStructures /home/marius/repos/DataStructures.jl/src/queue.jl:37
│┌ popfirst!(q::Deque{Int64}) @ DataStructures /home/marius/repos/DataStructures.jl/src/deque.jl:305
││ runtime dispatch detected: %33::Any(%34::Vector{Int64}, %35::Int64)::Any
│└────────────────────
´´´

@oxinabox
Copy link
Member

thanks!

@oxinabox oxinabox merged commit caa1bd0 into JuliaCollections:release-0.18 Feb 10, 2025
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