Skip to content

Argument unpacking is inefficient #1518

@slozier

Description

@slozier

Argument unpacking is done by calling

if (list.__len__() != 0) {
    return list.pop(0);
}

until the list is empty. This is quite inefficient since pop(0) shifts the contents of the underlying array to index 0 on every call.

The performance impact can be seen by the test added in #1516. On my machine it takes about 10 seconds to run whereas on CPython it takes a fraction of a second.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions