Skip to content

Popping in lists is slow #2741

Open
@advikkabra

Description

@advikkabra

The following code snippet:

q: list[i32] = []
i: i32
for i in range(100000):
    q.append(i)

for i in range(100000):
    q.pop(0)

takes >30s on my machine, while the C++ equivalent takes 1.3s. This is due to inefficiencies in the pop function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions