classification
Title: posixpath.ismount performs extra lstat calls
Type: resource usage Stage: resolved
Components: Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: alex, brian.curtin, christian.heimes, python-dev
Priority: normal Keywords: patch

Created on 2013-07-22 15:07 by alex, last changed 2014-08-25 18:36 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
ismount.diff alex, 2013-07-22 15:14 review
ismount.diff alex, 2013-07-22 16:33 review
ismount-3k.diff alex, 2013-07-22 16:43 review
Messages (9)
msg193540 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2013-07-22 15:07
Right now it calls islink(), which does an lstat, and then does its own lstat on the same path. This can be optimized by inlining the body of islink and reusing the stat result.

(This has been identified as an actual issue in openstack-swift https://review.openstack.org/#/c/37929/ )
msg193542 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2013-07-22 15:14
Attached is a simple first pass at a diff against 2.7, shoudl be easy to port it to default.
msg193543 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2013-07-22 16:33
Addresses the review comments: returns to catching all oserrors
msg193544 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-22 16:38
LGTM
msg193545 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2013-07-22 16:43
Attached patch is against default. I don't have my ssh keys set up for this machine, so if someone else could land I'd be appreciative :)

(Not sure if this qualifies for a backport)
msg193551 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2013-07-22 17:16
Benjamin probably has the final say on backporting this to 2.7. I'm doing the 3.3/default commit right now.
msg193553 - (view) Author: Roundup Robot (python-dev) Date: 2013-07-22 18:08
New changeset 240adc564539 by Brian Curtin in branch 'default':
Fix #18530. Remove extra stat call from posixpath.ismount
http://hg.python.org/cpython/rev/240adc564539
msg193554 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2013-07-22 18:09
^That takes care of default. I misspoke in an earlier comment about 3.3 - that should probably be determined by that RM (Georg?)
msg225882 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2014-08-25 18:01
Ok, this was landed, 3.3 is no longer open so closing this.
History
Date User Action Args
2014-08-25 18:36:15berker.peksagsetstage: patch review -> resolved
2014-08-25 18:01:23alexsetstatus: open -> closed
resolution: fixed
messages: + msg225882
2013-07-22 18:09:49brian.curtinsetmessages: + msg193554
2013-07-22 18:08:37python-devsetnosy: + python-dev
messages: + msg193553
2013-07-22 17:16:36brian.curtinsetnosy: + brian.curtin
messages: + msg193551
2013-07-22 16:43:51alexsetfiles: + ismount-3k.diff

messages: + msg193545
2013-07-22 16:38:36christian.heimessetversions: + Python 3.3, Python 3.4
nosy: + christian.heimes

messages: + msg193544

type: resource usage
stage: patch review
2013-07-22 16:33:15alexsetfiles: + ismount.diff

messages: + msg193543
2013-07-22 15:14:32alexsetfiles: + ismount.diff
keywords: + patch
messages: + msg193542
2013-07-22 15:07:40alexcreate