Serhiy Storchaka added the comment:
Here is alternative patch. I believe it makes a code simpler.
Microbenchmarks:
$ ./python -m timeit -n 100000 -s "from ntpath import splitdrive"
"splitdrive('c:foo')"
Before: 100000 loops, best of 3: 20 usec per loop
After: 100000 loops, best of 3: 11.5 usec per loop
$ ./python -m timeit -n 100000 -s "from ntpath import splitext"
"splitext('python.exe')"
Before: 100000 loops, best of 3: 23.6 usec per loop
After: 100000 loops, best of 3: 18 usec per loop
$ ./python -m timeit -s "from ntpath import join" "join('foo', 'bar')"
Before: 10000 loops, best of 3: 50.9 usec per loop
After: 10000 loops, best of 3: 32.3 usec per loop
$ ./python -m timeit -s "from ntpath import normpath"
"normpath('/foo/bar/baz')"
Before: 10000 loops, best of 3: 67.5 usec per loop
After: 10000 loops, best of 3: 40.3 usec per loop
$ ./python -m timeit -s "from ntpath import relpath" "relpath('foo', 'bar')"
Before: 1000 loops, best of 3: 695 usec per loop
After: 1000 loops, best of 3: 456 usec per loop
----------
nosy: +serhiy.storchaka
versions: +Python 3.5 -Python 3.4
Added file: http://bugs.python.org/file36030/ntpath_cleanup.diff
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com