Mark Dickinson <dicki...@gmail.com> added the comment:
This is expected. Your timing measures the time for garbage collection of the large arrays in addition to the time for the result to be returned. In the line `result = myfunc()`, the name `result` gets rebound to the value of `myfunc()`. That means that `result` is unbound from whatever it was previously bound to, and the old value then gets garbage collected. You can test this by adding a "del result" line as the last line inside the "for" loop block. ---------- nosy: +mark.dickinson resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46971> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com