[issue26297] Move constant folding to AST level

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: > we need to move some optimizations from bytecode level to AST level You may be aware that there is a long list of similar (old) issues proposing something similar: https://www.python.org/dev/peps/pep-0511/#usage-1-ast-optimizer My PEP 511 tries to propose a

[issue26287] Core dump in f-string with formatting errors

2016-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9095a5787a82 by Eric V. Smith in branch 'default': Fix issue 26287: While handling FORMAT_VALUE opcode, the top of stack was being corrupted if an error occurred in PyObject_Format(). https://hg.python.org/cpython/rev/9095a5787a82 -- nosy:

[issue24683] Type confusion in json encoding

2016-02-05 Thread paul
paul added the comment: Sorry, I wasn't clear enough. This POC is a proof that the original bug can be used for EIP control. I just checked and it works as advertised on 2.7 revision: https://hg.python.org/cpython/rev/2d39777f3477 - it's a parent of

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: As to weather we want this patch committed or not, here's a mini-macro-something benchmark: $ ./python.exe -m timeit -s "x=2" "x + 10 + x * 20 + x* 10 + 20 -x" 1000 loops, best of 3: 0.115 usec per loop $ python3.5 -m timeit -s "x=2" "x + 10 + x * 20 +

Re: [issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread M.-A. Lemburg
On 05.02.2016 16:14, STINNER Victor wrote: > > Please don't. I would like to have time to benchmark all these patches (there > are now 9 patches attached to the issue :-)) and I would like to hear > Serhiy's feedback on your latest patches. Regardless of the performance, the fastint5.patch

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: My analysis of benchmarks. Even using CPU isolation to run benchmarks, the results look unreliable for very short benchmarks like 3 ** 2.0: I don't think that fastint_alt can make the operation 16% slower since it doesn't touch this code, no? Well... as

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: Anyways, if it's about macro vs non-macro, I can inline the macro by hand (which I think is an inferior approach here). But I'd like the final code to use my approach of using slots directly, instead of modifying longobject/floatobject to export lots of

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: Unless there are any objections, I'll commit fastint5.patch in a day or two. -- ___ Python tracker ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: >> Unless there are any objections, I'll commit fastint5.patch in a day or two. > Please don't. I would like to have time to benchmark all these patches (there > are now 9 patches attached to the issue :-)) and I would like to hear > Serhiy's feedback on your

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: bench_long2.py: my updated microbenchmark to test many types and more operations. compare.txt: compare Python original, fastint_alt.patch, fastintfloat_alt.patch and fastint5.patch. "(*)" marks the minimum of the line, percents are relative to the minimum

[issue19217] Calling assertEquals for moderately long list takes too long

2016-02-05 Thread Chris AtLee
Chris AtLee added the comment: Switching this to unified_diff allows the test case to finish nearly instantly. The downside is that the output is changed in the case of a difference found: FF == FAIL: test_compare

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: > Regardless of the performance, the fastint5.patch looks like the least invasive approach to me. It also doesn't incur as much maintenance overhead as the others do. Thanks. It's a result of an enlightenment that can only come after running benchmarks all day

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: > Between fastintfloat_alt.patch and fastint5.patch, I prefer > fastintfloat_alt.patch which is much easier to read, so probably much easier > to debug. I hate huge macro when I have to debug code in gdb :-( I also like > very much the idea of *reusing*

[issue19217] Calling assertEquals for moderately long list takes too long

2016-02-05 Thread Chris AtLee
Changes by Chris AtLee : Added file: http://bugs.python.org/file41824/cpython-issue19217.diff ___ Python tracker ___

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-05 Thread Zach Byrne
Zach Byrne added the comment: I'm attaching output from a selection of the benchmarks, I'm counting non-builtins and slices, but for everything, not just lists and tuples. Quick observation: math workloads seem list heavy, text workloads seem dict heavy, and tuples are usually somewhere in

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My patches were just samples. I'm glad that Yury incorporated the main idea and that this helps. If apply any patch I would prefer fastint5.patch. But I don't quite understand why it adds any gain. Is this just due to overhead of calling PyNumber_Add? Then

[issue23551] IDLE to provide menu link to PIP gui.

2016-02-05 Thread Upendra Kumar
Upendra Kumar added the comment: I trying to write the Tk application for the pip package manager. It is in very initial stage, with none of the functionalities implemented yet. I have attached the current state of code written by me. I have also included the wrapper provided by Terri for pip

[issue26287] Core dump in f-string with formatting errors due to refcount bug

2016-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: The problem has to do with refcounting when an error occurs. Adjusting the title accordingly. I'm not sure yet if the problem is in PyObject_Format(), or in handling errors in the eval loop when processing FORMAT_VALUE opcodes. I'm slowly tracking it down. It

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: > Unless there are any objections, I'll commit fastint5.patch in a day or two. Please don't. I would like to have time to benchmark all these patches (there are now 9 patches attached to the issue :-)) and I would like to hear Serhiy's feedback on your latest

[issue24683] Type confusion in json encoding

2016-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The same result on 2.7 branch: $ ./python ../cpython/eip.py Traceback (most recent call last): File "../cpython/eip.py", line 21, in e = j.make_encoder(markers, None, enc, 4, "ks", "is", False, True, True) TypeError: make_encoder() argument 1 must be

[issue22107] tempfile module misinterprets access denied error on Windows

2016-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: closed -> open ___ Python tracker ___ ___

[issue26296] colorys rgb_to_hls algorithm error

2016-02-05 Thread Shashank Agarwal
Shashank Agarwal added the comment: I would like to work on this.. -- nosy: +The_Knight ___ Python tracker ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks, Serhiy, > But I don't quite understand why it adds any gain. Perhaps, and this is just a guess - the fast path does only couple of eq tests & one call for the actual op. If it's long+long then long_add will be called directly. PyNumber_Add has

[issue26298] Split ceval.c into small files

2016-02-05 Thread STINNER Victor
New submission from STINNER Victor: Attached patch splits the huge "switch (opcode)" of ceval.c into smaller ceval_xxx.h files. New files: 93 Python/ceval_stack.h 142 Python/ceval_condjump.h 155 Python/ceval_misc.h 162 Python/ceval_fast.h 180 Python/ceval_module.h 238

[issue26298] Split ceval.c into small files

2016-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think this will make the code more readable. Rather less readable, since macros are defined in different file than used. -- ___ Python tracker

[issue26297] Move constant folding to AST level

2016-02-05 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For using more efficient bytecode (either specialized 8-bit opcodes or 16-bit opcodes) we need to move some optimizations from bytecode level to AST level, since LOAD_CONST variants could have variable size. Now with the Constant node this should be easy.

[issue24683] Type confusion in json encoding

2016-02-05 Thread paul
paul added the comment: Can you try on 2.7 branch? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26299] wsgiref.util FileWrapper raises ValueError: I/O operation on closed file.

2016-02-05 Thread Samwyse
New submission from Samwyse: While developing, I am using wsgiref.simple_server. Using to serve static content isn't working. The attached program demonstrates the issue. Run it and connect to http://127.0.0.1:8000/. You will see three buttons. Clicking on 'wsgi.filewrapper' causes the

[issue24683] Type confusion in json encoding

2016-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I can't reproduce your example paul. $ ./python eip.py Traceback (most recent call last): File "eip.py", line 21, in e = j.make_encoder(markers, None, enc, 4, "ks", "is", False, True, True) TypeError: make_encoder() argument 1 must be dict or None,

[issue21328] Resize doesn't change reported length on create_string_buffer()

2016-02-05 Thread Tamás Bence Gedai
Tamás Bence Gedai added the comment: Thanks for the remarks, I think the issue can be closed as well. -- ___ Python tracker ___

[issue1927] raw_input behavior incorrect if readline not enabled

2016-02-05 Thread Martin Panter
Changes by Martin Panter : -- Removed message: http://bugs.python.org/msg259637 ___ Python tracker ___

[issue21328] Resize doesn't change reported length on create_string_buffer()

2016-02-05 Thread Dustin Oprea
Dustin Oprea added the comment: I'm closing it. The ticket has been open two-years and no one else seemed to be interested in this issue until now, which leads me to believe that it's a PEBCAK/understanding issue. The rationale for why it's irrelevant seems sound. Thanks for digging through

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file41823/compare_to.txt ___ Python tracker ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file41822/compare.txt ___ Python tracker ___

[issue26292] Raw I/O writelines() broken

2016-02-05 Thread Martin Panter
Martin Panter added the comment: For BufferedIOBase, the documentation says write() will not return a short number of bytes, so I don’t see how writelines() is a problem there. For TextIOBase, the documentation is not so clear

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "My patches were just samples. I'm glad that Yury incorporated the main idea and that this helps." Oh, if even Serhiy prefers Yury's patches, I should read them again :-) -- I read fastint5.patch one more time and I finally understood the

[issue26297] Move constant folding to AST level

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Yury Selivanov added the comment: > In fact I'm -1 on using any kind of flag to trigger optimizations on or off. > Those flags will only drive confusion. If the optimizations are any good, > people will simply start using the flag all the time. Yeah, Guido

[issue26297] Move constant folding to AST level

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: *If* the PEP 511 is accepted, it will be super easy to start with an implementation in pure Python. But I think that we should benchmark the overhead of the Python API of PEP 511, because we need to convert all AST internal objects to Python objects, run the

[issue26300] "unpacked" bytecode

2016-02-05 Thread Andrew Barnert
New submission from Andrew Barnert: Currently, the compiler starts with a list of arrays of instructions, packs them to 1/3/6-bytes-apiece bytecodes, fixes up all the jumps, and then calls PyCode_Optimize on the result. This makes the peephole optimizer much more complicated. Assuming PEP 511

[issue26297] Move constant folding to AST level

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: > ast.Constant is *not* emited by the compiler to not break backward compatibility. I *know* that there is no stable API on AST, but I noticed some issues when working on my AST project. For example, pip doesn't work because an internal library uses AST and the

[issue26287] Core dump in f-string with formatting errors due to refcount bug

2016-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, that's my thinking as well. I'll have a patch soon-ish. -- ___ Python tracker ___

[issue26287] Core dump in f-string with formatting errors

2016-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: Now I think it's not a refcount problem. I'm going to switch to POP/PUSH instead of TOP/SET_TOP. I believe the problem is that I'm not adjusting the top of stack if there's an error. -- title: Core dump in f-string with formatting errors due to

[issue26287] Core dump in f-string with formatting errors

2016-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the report and the debugging help. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue26298] Split ceval.c into small files

2016-02-05 Thread Brett Cannon
Brett Cannon added the comment: I have a similar worry as Serhiy as I don't know where to find something like GET_AWAITABLE with that organization. -- nosy: +brett.cannon ___ Python tracker

[issue25228] Regression in cookie parsing with brackets and quotes

2016-02-05 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___

[issue22107] tempfile module misinterprets access denied error on Windows

2016-02-05 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue26287] Core dump in f-string with formatting errors due to refcount bug

2016-02-05 Thread Martin Panter
Martin Panter added the comment: I have zero experience with with ceval.c but I have a theory after looking over revision 1ddeb2e175df. I suspect “value” is a borrowed reference from TOP(), but at and

[issue26248] Improve scandir DirEntry docs, especially re symlinks and caching

2016-02-05 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks very much for all that added information! -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue26293] Embedded zipfile fields dependent on absolute position

2016-02-05 Thread spoo
spoo added the comment: I'm not familiar with iOS development, but I'd hazard a guess that "some zip library implementations" means a (the official?) iOS zip library. -- ___ Python tracker

[issue26145] PEP 511: Add sys.set_code_transformers()

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Rebased patch combining also pycf_transformed_ast.patch. -- Added file: http://bugs.python.org/file41816/transformers-5.patch ___ Python tracker

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: The test suite is not an appropriate workload to run benchmarks or statistics. Can you run with the benchmarks suite instead? -- ___ Python tracker

[issue26293] Embedded zipfile fields dependent on absolute position

2016-02-05 Thread spoo
New submission from spoo: Example: from zipfile import ZipFile with open('a.zipp', 'wb') as base: base.write(b'old\n') with ZipFile(base, 'a') as myzip: myzip.write('eggs.txt') If the embedded zip portion of the file is extracted (first four bytes deleted), some fields will be

[issue26292] Raw I/O writelines() broken

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: "(it's probably broken with non-blocking streams too, for the same reason)" Yes it is :-) We hitted this issue on eventlet when I changed the socket.send() method in eventlet 0.18 to stop sending data on partial write, whereas eventlet < 0.18 used a loop to

[issue26292] Raw I/O writelines() broken

2016-02-05 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +pitrou versions: +Python 3.5 ___ Python tracker ___

[issue26293] Embedded zipfile fields dependent on absolute position

2016-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka nosy: +alanmcintyre, serhiy.storchaka, twouters ___ Python tracker

[issue26098] PEP 510: Specialize functions with guards

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Oh, I missed comments on the code review. Fixed on patch version 8. -- Added file: http://bugs.python.org/file41818/specialize-8.patch ___ Python tracker

[issue26292] Raw I/O writelines() broken

2016-02-05 Thread STINNER Victor
New submission from STINNER Victor: Copy of Antoine Pitrou's email (sent in 2012 ;-): https://mail.python.org/pipermail/python-dev/2012-August/121396.html Hello, I was considering a FileIO.writelines() implementation based on writev() and I noticed that the current RawIO.writelines()

[issue26294] Queue().unfinished_tasks not in docs - deliberate?

2016-02-05 Thread Frank Millman
New submission from Frank Millman: dir(queue.Queue()) shows an attribute 'unfinished_tasks'. It appears to be the counter referred to in the docs to 'join()', but it is not documented itself. I would like to make use of it, but I don't know if it is part of the official API for this module.

[issue21328] Resize doesn't change reported length on create_string_buffer()

2016-02-05 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> not a bug stage: patch review -> resolved ___ Python tracker ___

[issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest

2016-02-05 Thread STINNER Victor
New submission from STINNER Victor: test_regrtest creates temporary test files called test_regrtest_pid_xxx.py in Lib/test/. The problem is that some tests like test___all__ and test_zipfile haves test relying on the list of Lib/test/test_*.py. When tests are run in parallel, test_regrtest

[issue26287] Core dump in f-string with lambda and format specification

2016-02-05 Thread Eric V. Smith
Changes by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker ___ ___

[issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: > The directory with test files can be read-only. test_regrtest skips tests which requires to write in Lib/test/ if the write fails. except PermissionError as exc: if not sysconfig.is_python_build(): self.skipTest("cannot

[issue26292] Raw I/O writelines() broken

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: > Is deprecating RawIOBase.writelines() an option, and only recommending > BufferedIOBase.writelines() and TextIOBase.writelines()? IMHO the problem is the same for other classes. -- ___ Python tracker

[issue26285] Garbage collection of unused input sections from CPython binaries

2016-02-05 Thread Alecsandru Patrascu
Alecsandru Patrascu added the comment: I've done again the experiments on larger workloads, such as our OpenStack Swift cluster, and it works without any issues. Also, I've attached an archive with a simple external module in CPython3 that uses PyMem_RawMalloc. The output is ok, and it's

[issue26292] Raw I/O writelines() broken

2016-02-05 Thread Martin Panter
Martin Panter added the comment: Is deprecating RawIOBase.writelines() an option, and only recommending BufferedIOBase.writelines() and TextIOBase.writelines()? Otherwise, I think it would make most sense to keep retrying until all the data is written. This mirrors how I understand readline()

[issue26296] colorys rgb_to_hls algorithm error

2016-02-05 Thread Mats Luspa
New submission from Mats Luspa: In the colorsys library function rgb_to_hls the algorithm is not implemented quite correctly. According to algorithm the correct implementation should be (the error is in the condition r == maxc). In the current code g

[issue26296] colorys rgb_to_hls algorithm error

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Oh, someone uses colorsys :-) -- nosy: +haypo, yselivanov ___ Python tracker ___

[issue26248] Improve scandir DirEntry docs, especially re symlinks and caching

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Ben Hoyt added the comment: > Seeing this has been merged (thanks Victor), can this issue be closed? As I wrote, I left the issue open for wait for feedback. I know that some people to read the doc online: https://docs.python.org/dev/library/os.html#os.DirEntry

[issue18199] Windows: support path longer than 260 bytes using "\\?\" prefix

2016-02-05 Thread Jens Diemer
Jens Diemer added the comment: I also with this problems. I have made a test script. There is a problem with os.chdir(): It doesn't work with \\?\ notation. And there is also a problem, if you use ``` import os import pathlib import tempfile with

[issue26248] Improve scandir DirEntry docs, especially re symlinks and caching

2016-02-05 Thread Ben Hoyt
Ben Hoyt added the comment: Seeing this has been merged (thanks Victor), can this issue be closed? Guido, are you happy with the changes given your comments at http://bugs.python.org/issue26032#msg257665? -- ___ Python tracker

[issue1927] raw_input behavior incorrect if readline not enabled

2016-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think we first should fix 3.6 in correct way, and then see what we can backport to other branches without breaking too much. Or left them as is. For example the output of --version was changed from strerr to stdout (issue18338, issue18920) in default

[issue23551] IDLE to provide menu link to PIP gui.

2016-02-05 Thread Upendra Kumar
Upendra Kumar added the comment: @Terry, I am an intended GSOC student and I came through this idea of developing a GUI based on Tkinter in the python core-mentorship mailing lists. You highlighted/mentioned this issue in the mailing list. -- ___

[issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest

2016-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The directory with test files can be read-only. test_regrtest should use temporary directory. -- nosy: +serhiy.storchaka ___ Python tracker

[issue26292] Raw I/O writelines() broken

2016-02-05 Thread Jakub Stasiak
Changes by Jakub Stasiak : -- nosy: +jstasiak ___ Python tracker ___ ___

[issue26280] ceval: Optimize [] operation similarly to CPython 2.7

2016-02-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: I also suggest counting the number of BINARY_SUBSCR calls that are *not* one of the builtin types under consideration. Also, it would be good to distinguish slicing from integer indexing, for lists and tuples. --

[issue26098] PEP 510: Specialize functions with guards

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Patch version 7: * Fix a random crash related to _testcapi.PyGuard: implement tp_traverse on PyFuncGuard and "inherit" tp_traverse on PyGuard * Fix a typo Include/funcobject.h * (rebase the patch) -- Added file:

[issue26296] colorys rgb_to_hls algorithm error

2016-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +easy stage: -> needs patch ___ Python tracker ___

[issue25228] Regression in cookie parsing with brackets and quotes

2016-02-05 Thread Will Harris
Changes by Will Harris : -- nosy: +harris ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: I think this is a duplicate of http://bugs.python.org/issue26280... -- ___ Python tracker ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: msg223186, Serhiy Storchaka about inline.patch: "Confirmed speed up about 20%. Surprisingly it affects even integers outside of the of preallocated small integers (-5...255)." The optimization applies to Python int with 0 or 1 digit so in range [-2^30+1;

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Nice enhancement. /* Fast path; single digit will always fit decimal. This improves performance of FP/long operations by at least 20%. This is even visible on macro-benchmarks. */ I'm not sure that "spectral_norm" can be qualified as macro-benchmark.

[issue26240] Docstring of the subprocess module should be cleaned up

2016-02-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree. The module docstring should briefly describe the module and maybe list the contents, a line for each. The itertools docstring does the latter; the math docstring does not, though I would not mind if it did. -- nosy: +terry.reedy

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: myself> Ok. Now I'm lost. We have so many patches :-) Which one do you prefer? I read again fully this *old* issue, well, *almost* all messages. Well, it's clear that no consensus was found yet :-) I see two main trends: optimize most cases (optimize most

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: > I think this is a duplicate of http://bugs.python.org/issue26280... Oh, I missed this one. I didn't understand "[]" in the title. I didn't understand the purpose of optimizing BUILD_LIST :-D -- resolution: -> duplicate status: open -> closed

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
New submission from STINNER Victor: Copy of msg222985 by Raymond Hettinger from issue #21955: "There also used to be a fast path for binary subscriptions with integer indexes. I would like to see that performance regression fixed if it can be done cleanly." -- messages: 259708 nosy:

[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Oh, I just created a duplicate with a patch for list[int]: issue #26301. -- ___ Python tracker ___

[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2016-02-05 Thread STINNER Victor
Changes by STINNER Victor : -- title: ceval: Optimize [] operation similarly to CPython 2.7 -> ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 ___ Python tracker

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 986184c355e8 by Yury Selivanov in branch 'default': Issue #26288: Optimize PyLong_AsDouble. https://hg.python.org/cpython/rev/986184c355e8 -- nosy: +python-dev ___ Python tracker

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks a lot for the review, Serhiy! -- resolution: -> fixed stage: -> resolved status: open -> closed type: -> performance ___ Python tracker

[issue10044] small int optimization

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Issue #21955 is a spin-off of this issue. -- ___ Python tracker ___ ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Changes by Yury Selivanov : Added file: http://bugs.python.org/file41831/fastint5_4.patch ___ Python tracker ___

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: (Oops, I attached the wrong patch, fixed in patch v2.) Quick & dirty micro-benchmark: Original: $ ./python -m timeit -s 'lst=list("hello")' 'lst[2]' 1000 loops, best of 3: 0.0261 usec per loop Patched: $ ./python -m timeit -s 'lst=list("hello")'

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file41833/binary_subscr.patch ___ Python tracker ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: Attached is the new version of fastint5 patch. I fixed most of the review comments. I also optimized %, << and >> operators. I didn't optimize other operators because they are less common. I guess we have to draw a line somwhere... Victor, thanks a lot

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Changes by Yury Selivanov : Added file: http://bugs.python.org/file41830/fastint5_3.patch ___ Python tracker ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: inline-2.patch: more complete version of inline.patch. Optimize the same instructions than Python 2: BINARY_ADD, INPLACE_ADD, BINARY_SUBSTRACT, INPLACE_SUBSTRACT. Quick & *dirty* microbenchmark: $ ./python -m timeit -s 'x=1'

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: > Ok. Now I'm lost. We have so many patches :-) Which one do you prefer? To no-ones surprise I prefer fastint5, because it optimizes almost all binary operators on both ints and floats. inline-2.patch only optimizes just + and - for just ints. If + and -

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file41833/binary_subscr.patch ___ Python tracker

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: msg222985: Raymond Hettinger "There also used to be a fast path for binary subscriptions with integer indexes. I would like to see that performance regression fixed if it can be done cleanly." The issue #26280 was opened to track this optimization.

[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2016-02-05 Thread Ned Deily
Changes by Ned Deily : -- resolution: fixed -> stage: resolved -> needs patch ___ Python tracker ___

  1   2   >