ironpython3 icon indicating copy to clipboard operation
ironpython3 copied to clipboard

Argument unpacking is inefficient

Open slozier opened this issue 2 years ago • 0 comments

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 https://github.com/IronLanguages/ironpython3/pull/1516. On my machine it takes about 10 seconds to run whereas on CPython it takes a fraction of a second.

slozier avatar Jul 30 '22 02:07 slozier