This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Cleanup and microoptimize pathlib
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: pitrou Nosy List: cool-RR, pitrou, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-12-16 19:49 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pathlib_cleanup.patch serhiy.storchaka, 2013-12-16 19:49 review
pathlib_cleanup_compatible.patch serhiy.storchaka, 2013-12-16 21:49 review
Messages (8)
msg206357 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-16 19:49
Here is a patch which contains many small cleanups and optimizations for the pathlib module. Not all of them can be backported to 2.7 version.
msg206365 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-12-16 20:26
Ok, since it makes backporting more tedious, I'd rather keep this for post-3.4.
msg206375 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-16 21:49
Here is compatible with 2.7 part of the patch. It is important to apply it before 3.4 release otherwise supporting different versions will be more tedious.
msg206376 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-12-16 21:50
> Here is compatible with 2.7 part of the patch. It is important to
> apply it before 3.4 release otherwise supporting different versions
> will be more tedious.

Do you have performance numbers that show a significant improvement?
msg206377 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-16 22:06
> Do you have performance numbers that show a significant improvement?

No. The benefit is too small (but theoretically it should be). Some changes 
also simplify the code. This is why this patch should be applied now, while 
pathlib code is not frozen yet.

For example "drv or root" replaced by "root or drv" because drv is always 
false on Unix and both arguments of "or" should be evaluated. This is very 
tiny optimization, but it has zero cos if apply it right now.
msg231645 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-25 09:15
If you are not interested in any of proposed changes Antoine, this issue can be closed.
msg231646 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-11-25 09:21
Not really, sorry.
msg369789 - (view) Author: Ram Rachum (cool-RR) * Date: 2020-05-24 11:29
Antoine: Serhiy linked me to this issue when I opened #40753 . Do you think that this patch by Serhiy could now be merged?
History
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64201
2020-05-24 11:29:06cool-RRsetnosy: + cool-RR
messages: + msg369789
2014-11-25 11:42:09serhiy.storchakasetresolution: rejected
stage: patch review -> resolved
2014-11-25 09:21:25pitrousetstatus: pending -> closed

messages: + msg231646
2014-11-25 09:18:29serhiy.storchakasetstatus: open -> pending
2014-11-25 09:15:02serhiy.storchakasetmessages: + msg231645
2013-12-16 22:06:59serhiy.storchakasetmessages: + msg206377
2013-12-16 21:50:31pitrousetmessages: + msg206376
2013-12-16 21:49:27serhiy.storchakasetfiles: + pathlib_cleanup_compatible.patch

messages: + msg206375
2013-12-16 20:26:56pitrousetmessages: + msg206365
versions: + Python 3.5, - Python 3.4
2013-12-16 19:49:49serhiy.storchakacreate