Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37029

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:PyObject_Free is O(N) where N = # of arenas
Type:performanceStage:resolved
Components:Interpreter CoreVersions:Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: tim.petersNosy List: fwolff, methane, tim.peters
Priority:normalKeywords:patch

Created on2019-05-24 05:33 bymethane, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
arena.pytim.peters,2019-05-31 05:15Big test case - needs over 80GB of RAM
result.txtmethane,2019-05-31 15:51
free_arenas.txtfwolff,2019-06-03 05:59output with 2x and 4x strings
Pull Requests
URLStatusLinkedEdit
PR 13612mergedtim.peters,2019-05-28 06:01
Messages (8)
msg343344 -(view)Author: Inada Naoki (methane)*(Python committer)Date: 2019-05-24 05:33
Reported here:*https://stackoverflow.com/questions/56228799/python-hangs-indefinitely-trying-to-delete-deeply-recursive-object*https://mail.python.org/pipermail/python-dev/2019-May/157635.html
msg343734 -(view)Author: Tim Peters (tim.peters)*(Python committer)Date: 2019-05-28 06:05
Created a PR and assigned myself to this bug.
msg344024 -(view)Author: Tim Peters (tim.peters)*(Python committer)Date: 2019-05-31 05:15
Added file arena.py.  This adds some code to the OP's original test, to print out build time and teardown time, and display obmalloc stats.You'll need at least 80GB of RAM to run it - I don't have that much.  Building the tree may take on the order of an hour, but the time to tear it down is what's interesting here.  Apparently 3.7.3 needs more than 4 hours to reclaim the memory.
msg344082 -(view)Author: Inada Naoki (methane)*(Python committer)Date: 2019-05-31 15:51
master:build time 0:48:53.664428teardown time 4:58:20.132930patched:build time 0:48:08.485639teardown time 0:01:10.466707About 250x speedup!
msg344083 -(view)Author: Tim Peters (tim.peters)*(Python committer)Date: 2019-05-31 16:01
Thank you so much, Inada!  That's very good to hear :-)
msg344141 -(view)Author: Tim Peters (tim.peters)*(Python committer)Date: 2019-06-01 02:16
New changeset1c263e39c4ed28225a7dc8ca1f24953225ac48ca by Tim Peters in branch 'master':bpo-37029:  keep usable_arenas in sorted order without searching (#13612)https://github.com/python/cpython/commit/1c263e39c4ed28225a7dc8ca1f24953225ac48ca
msg344383 -(view)Author: Friedel Wolff (fwolff)Date: 2019-06-03 05:59
I had a bit of time and access to a pretty big machine, so I ran the remove-arena-search branch with the same number of iterations, but also 2x and 4x as many. I attach the output in case it is interesting. The timings seem to be growing linearly with the number of strings. The teardown finishes within minutes.
msg344474 -(view)Author: Tim Peters (tim.peters)*(Python committer)Date: 2019-06-03 20:51
Thank you, Friedl!  I appreciate the extra confirmation - and especially on even bigger test cases :-)
History
DateUserActionArgs
2022-04-11 14:59:15adminsetgithub: 81210
2019-06-03 20:51:08tim.peterssetmessages: +msg344474
2019-06-03 05:59:52fwolffsetfiles: +free_arenas.txt
nosy: +fwolff
messages: +msg344383

2019-06-01 02:19:40tim.peterssetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-06-01 02:16:08tim.peterssetmessages: +msg344141
2019-05-31 16:01:53tim.peterssetmessages: +msg344083
2019-05-31 15:51:44methanesetfiles: +result.txt

messages: +msg344082
2019-05-31 05:15:49tim.peterssetfiles: +arena.py

messages: +msg344024
2019-05-28 06:05:01tim.peterssetassignee:tim.peters
messages: +msg343734
2019-05-28 06:01:51tim.peterssetkeywords: +patch
stage: patch review
pull_requests: +pull_request13516
2019-05-24 12:40:43methanesettitle: PyObject_Free is O(N^2) where N = # of arenas -> PyObject_Free is O(N) where N = # of arenas
2019-05-24 05:33:57methanecreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp