[issue26270] Support for read()/write()/select() on asyncio

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: Paulo Costa: > async def async_read(fd. n): This method already exists: * (TCP) https://docs.python.org/dev/library/asyncio-protocol.html#asyncio.Protocol.data_received * (UDP)

[issue26256] Fast decimalisation and conversion to other bases

2016-02-03 Thread Jurjen N.E. Bos
Jurjen N.E. Bos added the comment: That reference you gave says that the binary version is faster than the Python version, but here the _complexity_ actually changed by a lot. Only people who know the library by name will notice that it is this fast. But you are right, for 99% of the people it

[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-02-03 Thread Gedai Tamás Bence
Gedai Tamás Bence added the comment: Added a small patch that solves this issue on Ubuntu 15.10. Produces output like: /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libbz2.so.1.0 I'd be glad to add some test cases if someone can give me some tips on how

[issue26272] `zipfile.ZipFile` fails reading a file object in specific version(s)

2016-02-03 Thread Pengyu Chen
Pengyu Chen added the comment: Oh yes you're right Martin. Thanks for the notice :) (I've closed this ticket before seeing your reply) -- ___ Python tracker

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: I like the feature, but I would prefer to use a syntax like --affinity=0-2 to use cores 0, 1 and 2, rather than having to compute manually a binary mask (--affinity=3). It's a builtin feature of taskset: just use --cpu-list. -- nosy: +haypo

[issue26272] `zipfile.ZipFile` fails reading a file object in specific version(s)

2016-02-03 Thread Martin Panter
Martin Panter added the comment: I think you are only meant to pass in a “binary” (bytes) file object. Maybe BufferedIOBase, I’m not sure. The documentation doesn’t seem to make this very clear though. Can you suggest an improvement? Open the file with a = open("testfile.zip", "rb") and all

[issue26273] Expose TCP_CONGESTION and TCP_USER_TIMEOUT to the socket module

2016-02-03 Thread Omar Sandoval
New submission from Omar Sandoval: The socket module is missing a couple of TCP socket options: TCP_CONGESTION was added to Linux in v2.6.13 and TCP_USER_TIMEOUT was added in v2.6.37. These should be exposed. -- components: Library (Lib) files: socket_tcp_options.patch keywords: patch

[issue26256] Fast decimalisation and conversion to other bases

2016-02-03 Thread Jurjen N.E. Bos
Jurjen N.E. Bos added the comment: OMG is decimal that fast? Maybe I should change the issue then to "documentation missing": it nowhere says in the documentation that decimal has optimized multiprecision computations. It only says that precision "can be as large as needed for a given

[issue26272] `zipfile.ZipFile` fails reading a file object in specific version(s)

2016-02-03 Thread Pengyu Chen
New submission from Pengyu Chen: When passing a file object to `zipfile.ZipFile` for reading it fails in Python 3.5.1 it fails. While the same code in Python 2.7.11 works. Also loading that specific file directly from file path works in Python 3.5.1. (Please see the sample testing code below

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
New submission from Florin Papa: Hi all, This is Florin Papa from the Dynamic Scripting Languages Optimizations Team from Intel Corporation. The patch submitted adds an affinity feature to the Grand Unified Python Benchmarks suite to allow running benchmarks on a given CPU/set of CPUs. It is

[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-02-03 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Thanks Martin. The MAC_OS_X_VERSION_10_5 macro ensures that Python is still compatible with Mac OS before version 10.5: if it's built on 10.4 or older, it locks around getaddrinfo (since it's not thread-safe there), and on 10.5 and later it doesn't

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
Changes by STINNER Victor : -- type: -> performance ___ Python tracker ___ ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
Florin Papa added the comment: Thank you for the feedback. Please see the updated patch. -- Added file: http://bugs.python.org/file41791/affinity_v2.patch ___ Python tracker

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
Florin Papa added the comment: I was thinking that a warning might go unnoticed, that is why I chose to end the program if taskset is not found. It would force the user to install missing packages. Otherwise the patch looks ok. -- ___ Python

[issue26256] Fast decimalisation and conversion to other bases

2016-02-03 Thread Stefan Krah
Stefan Krah added the comment: On Wed, Feb 03, 2016 at 09:51:53AM +, STINNER Victor wrote: > Well, nowhere means: > https://docs.python.org/dev/whatsnew/3.3.html#decimal Okay, but hardly anyone reads that, and I can't blame them. :) For example, if I use something like Lua, I won't read a

[issue26275] perf.py: bm_regex_v8 doesn't seem reliable even with --rigorous

2016-02-03 Thread STINNER Victor
New submission from STINNER Victor: Hi, I'm working on some optimizations projects like FAT Python (PEP 509: issue #26058, PEP 510: issue #26098, and PEP 511: issue #26145) and faster memory allocators (issue #26249). I have the *feeling* that perf.py output is not reliable even if it takes

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
Florin Papa added the comment: I have updated the patch to throw an exception if the taskset command is not available. Not checking that taskset works will generate an ambiguous error (if there is no taskset on the system) that does not explicitly point to the problem. I believe that users

[issue26275] perf.py: bm_regex_v8 doesn't seem reliable even with --rigorous

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: Well, it was simpler than I expected to implement calibration. Here is a PoC for regex_v8 and json_dump_v2. json_dump_v2 takes 3 seconds per run, but it already uses internally 100 loop iterations. I divided the number of iterations by 100 in my patch.

[issue26272] `zipfile.ZipFile` fails reading a file object in specific version(s)

2016-02-03 Thread Pengyu Chen
Pengyu Chen added the comment: Well I should have noticed that I wasn't using binary mode.. Sorry for the mistake. Closing the issue report. -- status: open -> closed ___ Python tracker

[issue26256] Fast decimalisation and conversion to other bases

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: "It's great to have this stuff, but I don't think it belongs in core Python: I'd much rather that the core Python integer implementation remain simple, portable and low-maintenance, and work well for the domain it's intended for: small-to-medium size

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-03 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +florin.papa title: perf.py: bm_regex_v8 doesn't seem reliable even with --rigorous -> perf.py: calibrate benchmarks using time, not using a fixed number of iterations ___ Python tracker

[issue25774] [benchmarks] Adjust to allow uploading benchmark data to codespeed

2016-02-03 Thread Zachary Ware
Changes by Zachary Ware : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Zach, first I was going to collect some stats on this (as Serhiy also suggests). It would be interesting to collect some stats on how many times BINARY_SUBSCR receives lists, tuples, dicts, and other types. I'd instrument the code to collect those stats and

[issue26219] implement per-opcode cache in ceval

2016-02-03 Thread Francis MB
Francis MB added the comment: >From the two checks on Python/compile.c: + expr_ty meth = e->v.Call.func; [...] +/* Check [...] that + the call doesn't have keyword parameters. */ [...] +/* Check that there are no *varargs types of arguments. */ [...] I just wonder how many times

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

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Zach, BTW, you can see how I instrumented ceval for stats collection in the patch for issue #26219. That's only for the research purposes, we won't commit that... or maybe we will, but in a separate issue :). --

[issue26282] Add support for partial keyword arguments in extension functions

2016-02-03 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently extension functions either accept only positional-only arguments (PyArg_ParseTuple), or keyword arguments (PyArg_ParseTupleAndKeywords). While adding support passing by keywords looks good for some arguments, for other arguments it doesn't make

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: > If running time is close to the limit, different run will use different > number of repetitions. This will add additional instability. Maybe, to be honest I don't know. How can we decide if a patch makes perf.py more and less stable? > I prefer a stable

[issue24905] Allow incremental I/O to blobs in sqlite3

2016-02-03 Thread Aviv Palivoda
Aviv Palivoda added the comment: I did the needed changes for the pull request at pysqlite for porting to python3. I will continue updating the patch if there will be changes in pysqlite and vice versa. -- keywords: +patch Added file: http://bugs.python.org/file41798/blob.patch

[issue25774] [benchmarks] Adjust to allow uploading benchmark data to codespeed

2016-02-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9923b81a1d34 by Zachary Ware in branch 'default': Issue #25774: Add raw mode to perf.py. https://hg.python.org/benchmarks/rev/9923b81a1d34 -- nosy: +python-dev ___ Python tracker

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

2016-02-03 Thread Zach Byrne
Zach Byrne added the comment: Yury, Are you going to tackle this one, or would you like me to? -- ___ Python tracker ___

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

2016-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would be nice to collect statistics about arguments types during running the testsuite. May be list is not the most popular type of collection. -- nosy: +serhiy.storchaka ___ Python tracker

[issue26252] Add an example to importlib docs on setting up an importer

2016-02-03 Thread Simon Cross
Changes by Simon Cross : -- nosy: +hodgestar ___ Python tracker ___ ___ Python-bugs-list

[issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches()

2016-02-03 Thread Brett Cannon
New submission from Brett Cannon: Would it make sense to clear sys.path_importer_cache when someone calls importlib.invalidate_caches()? It is a cache after all. -- components: Library (Lib) messages: 259518 nosy: brett.cannon, eric.snow, ncoghlan priority: normal severity: normal

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-02-03 Thread Martin Panter
Martin Panter added the comment: I thought the 3.6.0 NEWS file generally listed bugs fixed since (at least) the 3.5.0 release. But the NEWS in default has no mention of Issue 26194. Serhiy is right that there is nothing more to do for the merging problem. I was just pointing out that

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: Florent: "I was thinking that a warning might go unnoticed, that is why I chose to end the program if taskset is not found." Oh right, I kept your behaviour and pushed a change. --- changeset: 238:a97acad3bbf7 tag: tip user:Victor Stinner

[issue26209] TypeError in smtpd module with string arguments

2016-02-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: Doc fixes unrelated to security fixes are not applied to security-fix-only versions. -- versions: -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue26276] Inconsistent behaviour of PEP 3101 formatting between versions

2016-02-03 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: I don't think that it's useful to check at runtime that taskset works. At least, I expect an error if the option is used and the command fails. To use CPU affinity you need to know your hardware and your platform. For most stable results you may even configure

[issue26277] Allow zipapp to target modules

2016-02-03 Thread flying sheep
New submission from flying sheep: currently, zipapp’s notion of __main__.py is very different from the usual. the root directory of a zipapp is not a module, therefore __init__.py isn’t used and relative imports from __main__.py don’t work. i propose that the zipapp functionality is

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue26276] Inconsistent behaviour of PEP 3101 formatting between versions

2016-02-03 Thread Eric V. Smith
Eric V. Smith added the comment: Hi, Mark. Yes, PEP 3101 is very much under-specified in this area. I tried to avoid the same mistake in PEP 498, although of course that's a different problem area. I don't recall why this particular case broke between 3.2.3 and 3.4.3. I'll try and track it

[issue26219] implement per-opcode cache in ceval

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: > From the two checks on Python/compile.c: Stuff done in compile.c is cached in *.pyc files. The for-loop you saw shouldn't take a lot of time - it iterates through function parameters, which an average function doesn't have more than 3-6. --

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-02-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: I can't say that I agree with putting an additional entry the 3.6 NEWS. In the past, I've not made news entries in unreleased versions regarding bug fixes in prior versions. That seems pointless to me and it would tend to clutter a document whose size

[issue26282] Add support for partial keyword arguments in extension functions

2016-02-03 Thread Martin Panter
Martin Panter added the comment: For the examples you gave, they already seem to support keywords for the first parameter: int(x=0), str(object=""), bytes(source=b""). Maybe it is a bit unfortunate that they are inconsistent, but these names seem reasonable when considered separately. But I

[issue25660] tabs don't work correctly in python repl

2016-02-03 Thread Berker Peksag
Berker Peksag added the comment: With rlcompleter.patch applied, I see the same behavior on my OS X (with libedit) and Ubuntu (with readline) systems. Thanks! -- nosy: +berker.peksag stage: patch review -> commit review ___ Python tracker

[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2016-02-03 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___

[issue26136] DeprecationWarning for PEP 479 (generator_stop)

2016-02-03 Thread Martin Panter
Martin Panter added the comment: FYI I found that changeset by doing annotate on the file that you originally changed , which is an index of the changesets that last modified each line. Thanks for the patch, I think it

[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-02-03 Thread Martin Panter
Martin Panter added the comment: IMO this should be treated as a new feature for the next release. But consistently returning the path sounds good to me if there is no good reason not to. Left a question on the review. I think you also need to update the documentation, and since this is

[issue26283] zipfile can not handle the path build by os.path.join()

2016-02-03 Thread 張伯誠
New submission from 張伯誠: I think the built-in library zipfile.py does not handle correctly the path build by os.path.join(). For example, assuming we have a zipfile named Test.zip which contanins a member xml/hello.xml, if you want to extract the member out, then you hava to use

[issue26279] time.strptime does not properly convert out-of-bounds values

2016-02-03 Thread Emanuel Barry
Changes by Emanuel Barry : -- nosy: +ebarry title: Possible bug in time library -> time.strptime does not properly convert out-of-bounds values versions: -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread Florin Papa
Florin Papa added the comment: No problem :) -- resolution: fixed -> status: closed -> open ___ Python tracker ___

[issue26278] BaseTransport.close() does not trigger connection_lost()

2016-02-03 Thread Sümer Cip
New submission from Sümer Cip: Hi all, We have implemented a TCP server based on asyncio. And while doing some regression tests we randomly see following error: 1) Client connects to the server. 2) Client is closed ungracefully(without sending a FIN, deplug cable) 3) We have a custom PING

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: "Florent" oops, Florin, sorry :-p -- ___ Python tracker ___ ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: Thanks for your contribution ;-) -- resolution: -> fixed status: open -> closed ___ Python tracker ___

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

2016-02-03 Thread Yury Selivanov
New submission from Yury Selivanov: See also issue #21955 -- components: Interpreter Core messages: 259492 nosy: haypo, yselivanov, zbyrne priority: normal severity: normal stage: needs patch status: open title: ceval: Optimize [] operation similarly to CPython 2.7 type: performance

[issue25660] tabs don't work correctly in python repl

2016-02-03 Thread Ned Deily
Ned Deily added the comment: LGTM on OS X with both the system libedit and a MacPorts GNU readline. Let's apply this. -- ___ Python tracker ___

[issue25660] tabs don't work correctly in python repl

2016-02-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 64417e7a1760 by Yury Selivanov in branch '3.5': Issue #25660: Fix TAB key behaviour in REPL. https://hg.python.org/cpython/rev/64417e7a1760 New changeset 87dfadd61e0d by Yury Selivanov in branch 'default': Merge 3.5 (issue #25660)

[issue25660] tabs don't work correctly in python repl

2016-02-03 Thread Berker Peksag
Berker Peksag added the comment: Thanks, Yury! Look like we forgot to update test_rcompleter: == FAIL: test_complete (test.test_rlcompleter.TestRlcompleter)

[issue26182] Deprecation warnings for the future async and await keywords

2016-02-03 Thread Marco Buttu
Marco Buttu added the comment: Thank you Brett, your explanation (msg259409) and the c-api doc are really straightforward. I think I can fix it in a few days, just the time to read the devguide and be confident about the workflow. -- ___ Python

[issue26136] DeprecationWarning for PEP 479 (generator_stop)

2016-02-03 Thread Anish Shah
Anish Shah added the comment: Thanks @martin.panter. I learnt something new, I didn't know about annotate before. I have updated the patch. Thanks again. -- Added file: http://bugs.python.org/file41800/issue26136_20160204.patch ___ Python tracker

[issue26115] pathlib.glob('**') returns only directories

2016-02-03 Thread JitterMan
JitterMan added the comment: It may be what the documentation says it will do, but is not what it should do. I believe that because: 1. Currently ** in pathlib matches only directories, but **.py matches files. That seems inconsistent. 2. In bash, and csh, ** matches files and directories. To

[issue26115] pathlib.glob('**') returns only directories

2016-02-03 Thread SilentGhost
Changes by SilentGhost : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue26283] zipfile can not handle the path build by os.path.join()

2016-02-03 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

[issue26096] '*' glob string matches dot files in pathlib

2016-02-03 Thread JitterMan
JitterMan added the comment: Globbing has been with us for almost 50 years, and in all that time it has never matched the hidden files/directories. There may be isolated cases where matching the hidden items is preferred, but generally that is not the case. Indeed, the primary characteristic

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

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Attaching a second version of the patch. (BTW, Serhiy, I tried your idea of using a switch statement to optimize branches (https://github.com/1st1/cpython/blob/fastint2/Python/ceval.c#L5390) -- no detectable speed improvement). I decided to add fast path

[issue26252] Add an example to importlib docs on setting up an importer

2016-02-03 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

[issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches()

2016-02-03 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

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

2016-02-03 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 04.02.2016 07:02, Yury Selivanov wrote: > Attaching a second version of the patch. (BTW, Serhiy, I tried your idea of > using a switch statement to optimize branches > (https://github.com/1st1/cpython/blob/fastint2/Python/ceval.c#L5390) -- no >

[issue26282] Add support for partial keyword arguments in extension functions

2016-02-03 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

[issue26263] Serialize array.array to JSON by default

2016-02-03 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +yselivanov ___ Python tracker ___ ___

[issue26276] Inconsistent behaviour of PEP 3101 formatting between versions

2016-02-03 Thread Mark Shannon
New submission from Mark Shannon: In Python 2.7.6 and 3.2.3: >>> "{ {{ 0} }}".format(**{' {{ 0} }': 'X'}) 'X' In Python 3.4.3: >>> "{ {{ 0} }}".format(**{' {{ 0} }': 'X'}) Traceback (most recent call last): File "", line 1, in ValueError: unexpected '{' in field name I think the problem is

[issue26243] zlib.compress level as keyword argument

2016-02-03 Thread Aviv Palivoda
Aviv Palivoda added the comment: Added the "suggested" test -- Added file: http://bugs.python.org/file41797/zlib-compress-level-keyword3.patch ___ Python tracker

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

2016-02-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 03/02/2016 18:21, Yury Selivanov a écrit : > > Yury Selivanov added the comment: > >> Yury suggested running perf.py twice with the binaries swapped > > Yeah, I had some experience with perf.py when its results were > skewed depending on what you test

[issue26279] Possible bug in time library

2016-02-03 Thread Ioannis Aslanidis
New submission from Ioannis Aslanidis: There seems to be a bug in the time library when performing the following conversion: """ In [8]: mytime=time.strptime(str([2015, 53, 0]), '[%Y, %U, %w]') In [9]: mytime Out[9]: time.struct_time(tm_year=2016, tm_mon=1, tm_mday=3, tm_hour=0, tm_min=0,

[issue26274] Add CPU affinity to perf.py

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: Hum, I modified your change: * only display a warning if the option is used but taskset doesn't work * remove check on Linux: taskset might be available on other platforms, it doesn't really matter to check the OS, we already check if the command works * try

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

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Attaching a new patch -- rewritten to optimize -, *, +, -=, *= and +=. I also removed the optimization of [] operator -- that should be done in a separate patch and in a separate issue. Some nano-benchmarks (best of 3): python -m timeit "sum([x + x + 1 for

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

2016-02-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: > In this table I've flipped the results for running the modified build > as > the reference, but in the new attachment, slower in the right > column means faster, I think :) I don't understand what this table means (why 4 columns?). Can you explain what you

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

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: > python -m timeit "sum([x * x * 1 for x in range(100)])" If you only want to benchmark x*y, x+y and list-comprehension, you should use a tuple for the iterator. -- ___ Python tracker

[issue26273] Expose TCP_CONGESTION and TCP_USER_TIMEOUT to the socket module

2016-02-03 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___

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

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury suggested running perf.py twice with the binaries swapped Yeah, I had some experience with perf.py when its results were skewed depending on what you test first. Hopefully Victor's new patch will fix that http://bugs.python.org/issue26275 --

[issue26277] Allow zipapp to target modules

2016-02-03 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +paul.moore ___ Python tracker ___ ___ Python-bugs-list

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

2016-02-03 Thread Zach Byrne
Zach Byrne added the comment: > Could you please take a look at the updated patch? Looks ok to me, for whatever that's worth. -- ___ Python tracker ___

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

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: > Fast patch is already implemented in long_mul(). May be we should just use > this function if both arguments are exact int, and apply the switch > optimization inside. Agree. BTW, what do you think about using __int128 when available? That way we can

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

2016-02-03 Thread STINNER Victor
STINNER Victor added the comment: I don't think. I run benchmarks (for __int128) :-) -- ___ Python tracker ___

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

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: > I don't think. I run benchmarks (for __int128) :-) Never mind... Seems that __int128 is still an experimental feature and some versions of clang even had bugs with it. -- ___ Python tracker

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

2016-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > BTW, what do you think about using __int128 when available? That way we can > also optimize twodigit PyLongs. __int128 is not always available and it will add too much of complexity for possible less gain. There is many ways to optimize the code and we

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

2016-02-03 Thread Zach Byrne
Zach Byrne added the comment: > I don't understand what this table means (why 4 columns?). Can you explain > what you did? Yury suggested running perf.py twice with the binaries swapped So "faster" and "slower" underneath "Baseline Reference" are runs where the unmodified python binary was

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-02-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Martin] > the default branch never got any NEWS entry in > 58266f5101cc, so maybe it needs to be added? No need for a news entry in default. We haven't released 3.6 yet, so the bugfix from 3.5 is just a carry forward of the corrected behavior. That

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

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Antoine, yeah, it's probably turbo boost related. There is no easy way to turn it off on mac os x, though. I hope Victor's patch to perf.py will help to mitigate this. Victor, Marc-Andre, Updated results of nano-bench (best of 10): -m timeit -s

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

2016-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fast patch is already implemented in long_mul(). May be we should just use this function if both arguments are exact int, and apply the switch optimization inside. -- ___ Python tracker

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Here's a very interesting table from Zach Byrne: http://bugs.python.org/issue21955#msg259490 It shows that some benchmarks are indeed very unstable. This also correlates with my own experience. These ones are very unstable: pickle_dict, nbody, regex_v8,

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

2016-02-03 Thread Zach Byrne
Zach Byrne added the comment: I ran 6 benchmarks on my work machine(not the same one as the last set) overnight. Two with just the BINARY_ADD change, two with the BINARY_SUBSCR change, and two with both. I'm attaching the output from all my benchmark runs, but here are the highlights In this

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

2016-02-03 Thread M.-A. Lemburg
On 03.02.2016 18:05, STINNER Victor wrote: > >> python -m timeit "sum([x * x * 1 for x in range(100)])" > > If you only want to benchmark x*y, x+y and list-comprehension, you > should use a tuple for the iterator. ... and precalculate that in the setup: python -m timeit -s

[issue26136] DeprecationWarning for PEP 479 (generator_stop)

2016-02-03 Thread Anish Shah
Anish Shah added the comment: Yes @martin.panter, the tests were failing. But, I didn't know where the tests for PendingDeprecationWarning were added. Thanks for telling the changeset. I have updated the patch. Can you please have a look? -- Added file:

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If running time is close to the limit, different run will use different number of repetitions. This will add additional instability. I prefer a stable number of repetitions manually calibrated for average modern computer. -- nosy: +serhiy.storchaka

[issue25774] [benchmarks] Adjust to allow uploading benchmark data to codespeed

2016-02-03 Thread Zachary Ware
Zachary Ware added the comment: Fair point, I'll leave out the upload script. Thanks for the review! -- ___ Python tracker ___