[issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work

2013-08-17 Thread STINNER Victor
STINNER Victor added the comment: 2013/8/18 Maries Ionel Cristian : > Well anyway, is there any way to preload libgcc ? Because in python2.x it > wasn't loaded at runtime. On Linux, you can try to set the LD_PRELOAD environment variable as a workaround. LD_PRELOAD=libgcc_s.so.1 python bug.py

[issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work

2013-08-17 Thread Maries Ionel Cristian
Maries Ionel Cristian added the comment: Alright ... would it be a very big hack to preload libgcc in the thread module (at import time) ? There is platform specific code there anyway, it wouldn't be such a big deal would it? -- ___ Python tracker

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread STINNER Victor
STINNER Victor added the comment: > The theory is sound, but it is going to take a good deal of effort to isolate > the effects (either good or bad) in realistic benchmarks. Oh, it was just asking for a microbenchmark on set(). I don't care of a "real" benchmark (realistic use case) for such is

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's an excerpt of the patch that gives a pretty good idea of that is being changed (there are essentially three lines of new logic): static void set_insert_clean(PySetObject *so, PyObject *key, Py_hash_t hash) { setentry *table = so->table; setent

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg195530 ___ Python tracker ___ ___ Python-bugs-list mailin

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's an excerpt from the patch that gives a pretty good idea of what is being changed (the three lines of new logic are marked): static void set_insert_clean(PySetObject *so, PyObject *key, Py_hash_t hash) { setentry *table = so->table; setentry *e

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread STINNER Victor
STINNER Victor added the comment: "+ Cache line benefit: improves the odds that the adjacent probe will be on the same cache line (...) + Reduced loop overhead: the second lookup doesn't require a new computation of the index *i* (we just do a XOR 1) (...)" With j=11, is the lookup at index 10

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: > With j=11, is the lookup at index 10 in the same cache line? It might or it might not. The cache lines are typically 64 bytes which holds 4 key/hash pairs. So, the odds are 75% in favor of an adjacent entry being in the same cache line. If malloc where

[issue18773] When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report the file descriptor

2013-08-17 Thread Vajrasky Kok
New submission from Vajrasky Kok: When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report which the file descriptor is the problematic one. Attached the patch to put the file descriptor in the aforementioned exception

[issue18773] When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report the file descriptor

2013-08-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: Same patch, but more pep8 compliant. -- Added file: http://bugs.python.org/file31347/add_file_descriptor_to_exception_signal_set_wakeup_fd_v2.patch ___ Python tracker __

[issue18773] When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report the file descriptor

2013-08-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: The errno is in the following line (the "[OSError]" one). -- ___ Python tracker ___ ___ Python-bugs-

[issue18562] Regex howto: revision pass

2013-08-17 Thread A.M. Kuchling
A.M. Kuchling added the comment: Slightly revised version that modifies the discussion of when to pre-compile a regex and when to not bother. I don't think this is a very important issue, so I don't think it needs a long discussion. -- Added file: http://bugs.python.org/file31348/rege

[issue18562] Regex howto: revision pass

2013-08-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, this is already too long IMO. Two sentences should suffice. If you are calling a regex very often in a loop, then it makes sense to compile it. Otherwise, don't bother. -- nosy: +pitrou ___ Python tracker

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's a simple benchmark to start with. On my machine (2.4Ghz Core2 Duo with 2MB L3 cache) and compiled with GCC-4.8, the benchmark shows a 6% speedup for sets that spill over L2 cache and 11% for sets that spill over the L3 cache. The theoretically expec

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file31350/insert_clean.s ___ Python tracker ___ ___ Python-bugs-list mailing

[issue18773] When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report the file descriptor

2013-08-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry, When I read "... wakeup fd:\n" my subconsciousness mind automatically translated it to "... wakeup fd: %d\n". Then you made me realized there is another error message below it. I closed this ticket as invalid. -- resolution: -> invalid status:

[issue4709] Mingw-w64 and python on windows x64

2013-08-17 Thread John Pye
John Pye added the comment: This bug is still present in Python 2.7.5 on Windows 64-bit . I am currently providing the following instructions for MinGW-w64 users wanting to link to Python27.dll: http://ascend4.org/Setting_up_a_MinGW-w64_build_environment#Setup_Python_for_compilation_of_extensi

[issue18774] There is still last bit of GNU Pth code in signalmodule.c

2013-08-17 Thread Vajrasky Kok
New submission from Vajrasky Kok: I read this commit: http://hg.python.org/cpython/rev/1d5f644b9241 But I noticed there is still GNU Pth code lingering around in Modules/signalmodule.c. Beside of that the WITH_PTH code (in the same file) is expired already. If you configure python with this o

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Attaching the detailed results of a CacheGrind analysis. Here are the high-points (all of which were expected): * The last level data cache miss-rate improved 12% (from 4.9% to 4.3%). * The first level data cache miss-rate improved 14% (from 5.5% to 4.7%).

[issue18771] Reduce the cost of hash collisions for set objects

2013-08-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Also, cachegrind shows a 3% improvement in the branch misprediction rate (from 9.9% to 9.6%). ==82814== Mispred rate: 9.9% ( 9.4% + 15.5% ==82812== Mispred rate: 9.6% ( 9.1% + 14.1% ) --

[issue18712] Pure Python operator.index doesn't match the C version.

2013-08-17 Thread Armin Rigo
Armin Rigo added the comment: For completeness, can you post one line saying why the much simpler solution "range(a).stop" is not accepted? -- ___ Python tracker ___ ___

<    1   2