You may very well be right, but I suspect that your testing methodology may have introduced some extra overhead. Mainly in the allocation of the list.
The higher order function calls list() at the end which makes a full copy of the entire result. The for-iteration is calling append repeatedly whereas the comprehension may have some trickery to allocate a list of the right size.
It would be useful to try to factor out the list allocation aspect of your test because those subtle differences are key.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You may very well be right, but I suspect that your testing methodology may have introduced some extra overhead. Mainly in the allocation of the list.
The higher order function calls list() at the end which makes a full copy of the entire result. The for-iteration is calling append repeatedly whereas the comprehension may have some trickery to allocate a list of the right size.
It would be useful to try to factor out the list allocation aspect of your test because those subtle differences are key.