[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2016-03-22 Thread John O'Connor
Changes by John O'Connor <j...@uber.com>: -- nosy: +jcon ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21423> ___ ___ Python

[issue6094] Python fails to build with Subversion 1.7

2014-06-28 Thread John O'Connor
John O'Connor added the comment: I encountered the same problem w/ 2.7.7. Temporary workaround: SVNVERSION=Unversioned directory ./configure make ... -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6094

[issue16398] deque.rotate() could be much faster

2013-01-11 Thread John O'Connor
John O'Connor added the comment: Looking at the implementation (rather quickly)[1]. I'm wondering if there is a reason why the appendleft(pop()) loop is required. It would seem the best way would be to determine the new head link, make the previous link the new end link and concatenate

[issue16398] deque.rotate() could be much faster

2013-01-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16398 ___ ___ Python-bugs-list mailing

[issue16465] dict creation performance regression

2013-01-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16465 ___ ___ Python-bugs-list mailing

[issue1508475] transparent gzip compression in urllib

2013-01-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1508475 ___ ___ Python-bugs-list mailing

[issue11695] Improve argparse usage/help customization

2013-01-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11695 ___ ___ Python-bugs-list mailing

[issue16445] SEGFAULT when deleting Exception.message

2013-01-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16445 ___ ___ Python-bugs-list mailing

[issue15948] Unchecked return value of I/O functions

2013-01-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___ ___ Python-bugs-list mailing

[issue12805] Optimizations for bytes.join() et. al

2012-10-20 Thread John O'Connor
John O'Connor added the comment: I think that's a good compromise and much better than what I had originally. - John -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12805

[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-17 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15381 ___ ___ Python-bugs-list mailing

[issue13903] New shared-keys dictionary implementation

2012-01-29 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13903 ___ ___ Python-bugs-list mailing

[issue13521] Make dict.setdefault() atomic

2011-12-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13521 ___ ___ Python-bugs-list mailing

[issue13217] Missing header dependencies in Makefile

2011-10-18 Thread John O'Connor
New submission from John O'Connor tehj...@gmail.com: I think ucs{1,2,4}lib.h, asciilib.h and a few other files should be in the Makefile deps list for unicodeobject.c. Patch included. -- components: Build files: makefile.patch keywords: patch messages: 145881 nosy: haypo, jcon

[issue13150] Most of Python's startup time is sysconfig

2011-10-12 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13150 ___ ___ Python-bugs-list mailing

[issue12807] Optimization/refactoring for {bytearray, bytes, unicode}.strip()

2011-10-11 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: New patch. Please double check the removal of _PyUnicode_XStrip. -- Added file: http://bugs.python.org/file23383/stringlib_strip2.patch ___ Python tracker rep...@bugs.python.org http

[issue12807] Move strip() to stringlib

2011-10-11 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- title: Optimization/refactoring for {bytearray, bytes, unicode}.strip() - Move strip() to stringlib ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12807

[issue12053] Add prefetch() for Buffered IO (experiment)

2011-10-03 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: Here is an update with the C implementation. I think a working prototype will be helpful before another round on python-dev. I'm not sure how to handle unseekable, non-blocking streams where the read returns before `skip` bytes

[issue13087] C BufferedReader seek() is inconsistent with UnsupportedOperation for unseekable streams

2011-10-01 Thread John O'Connor
New submission from John O'Connor tehj...@gmail.com: The C implementation of BufferedReader.seek() does not throw an UnsupportedOperation exception when its underlying stream is unseekable IF the current buffer can accommodate the seek in memory. It probably saves a few cycles

[issue12807] Optimization/refactoring for {bytearray, bytes, unicode}.strip()

2011-10-01 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: The patch no longer applies cleanly. Is there enough interest in this to justify rebasing? -- title: Optimizations for {bytearray,bytes,unicode}.strip() - Optimization/refactoring for {bytearray,bytes,unicode}.strip

[issue12911] Expose a private accumulator C API

2011-09-16 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12911 ___ ___ Python-bugs-list mailing

[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-09-09 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: Moved {l,r,}strip to stringlib as well as the bloom filters from unicodeobject. I think it cleans things up nicely. Now there is one implementation for all 3 types. This patch also improves performance for bytearray and slightly for bytes. I

[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-09-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: Removed file: http://bugs.python.org/file22982/strip_perf.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12807

[issue10408] Denser dicts and linear probing

2011-08-24 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10408 ___ ___ Python-bugs-list mailing

[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: You are right about those lines in particular; 'dubious' as you say. Though, the point overall was that the general implementation was noticeably faster (regardless of those smaller changes). However, I do think that the single check for len

[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: Removed file: http://bugs.python.org/file23040/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12807

[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: Antoine Pitrou pit...@free.fr added the comment: This looks like a dubious micro-optimization. If len == 0, all loops will exit early anyway (same for similar snippets in bytesobject.c and unicodeobject.c). You are right about those lines

[issue12805] Optimzations for bytes.join() et. al

2011-08-21 Thread John O'Connor
New submission from John O'Connor tehj...@gmail.com: I noticed there are a few more common cases that can be sped up in bytes.join(). When: - The sequence length and separator length are both 0 - The separator length is 0 or 1 - The separator string contains only 1 distinct byte These could

[issue12805] Optimizations for bytes.join() et. al

2011-08-21 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- title: Optimzations for bytes.join() et. al - Optimizations for bytes.join() et. al ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12805

[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-21 Thread John O'Connor
New submission from John O'Connor tehj...@gmail.com: bytearray() is using a less efficient implementation of split() than its similar friends bytes and unicode. I added a couple extra checks to return early in {bytes,unicode} split(). - if length is 0 - if left strip removed all bytes

[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2011-06-29 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11549 ___ ___ Python-bugs-list mailing

[issue5231] Change format of a memoryview

2011-06-20 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5231 ___ ___ Python-bugs-list mailing

[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-06-20 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10181 ___ ___ Python-bugs-list mailing

[issue12268] file readline, readlines readall methods can lose data on EINTR

2011-06-05 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12268 ___ ___ Python-bugs-list mailing

[issue9858] Python and C implementations of io are out of sync

2011-06-01 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9858 ___ ___ Python-bugs-list mailing

[issue12229] Remove unused variable in bufferedio.c

2011-05-31 Thread John O'Connor
New submission from John O'Connor tehj...@gmail.com: Remove second (unused) argument to _bufferedreader_peek_unlocked() -- components: IO files: bufferedreader_peek.patch keywords: patch messages: 137391 nosy: haypo, jcon, pitrou priority: normal severity: normal status: open title

[issue2091] file accepts 'rU+' as a mode

2011-05-31 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: It seems to me that adding the proper check is a good idea. It also may not be obvious to some that 'U' is now more or less an alias for 'r'. I have updated the patch so that it at least applies. I also removed a redundant `reading = 1

[issue1152248] Enhance file.readlines by making line separator selectable

2011-05-31 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1152248 ___ ___ Python-bugs-list mailing

[issue11197] information leakage with SimpleHTTPServer

2011-05-31 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11197 ___ ___ Python-bugs-list mailing

[issue8578] PyWeakref_GetObject

2011-05-31 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8578 ___ ___ Python-bugs-list mailing

[issue10399] AST Optimization: inlining of function calls

2011-05-31 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10399 ___ ___ Python-bugs-list mailing

[issue12053] Add prefetch() for Buffered IO (experiment)

2011-05-28 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: I started a draft in python. I am attaching the _pyio version along with tests. I will continue work on the C implementation and eventually documentation if this is well received. It seems straightforward, I am interested to see what you guys

[issue12053] Add prefetch() for Buffered IO (experiment)

2011-05-28 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: Added file: http://bugs.python.org/file22169/issue12053-tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12053

[issue12062] Buffered I/O inconsistent with unbuffered I/O in certain cases

2011-05-12 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12062 ___ ___ Python-bugs-list mailing

[issue9971] Optimize BufferedReader.readinto

2011-05-11 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: I've attached the latest changes based on feedback (issue9971-v5.patch) for i in 1 4 128 256 1024 2048 4069 8192 16384; do echo -n buffer_size=$i ; ./python -m timeit -s f=open('LICENSE','rb');b=bytearray($i) f.seek(0) while f.readinto(b

[issue9971] Optimize BufferedReader.readinto

2011-05-10 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: Victor: AFAIK its not actually downcasting. The safe downcast just uses an assertion when debugging is enabled. I chose to use it because it seems to be a convention in the file. Antoine: You say quirky, I say elegant :) Though I have

[issue12053] Add prefetch() for Buffered IO (experiment)

2011-05-10 Thread John O'Connor
New submission from John O'Connor tehj...@gmail.com: A prefetch() method for Buffered IO may greatly assist 3rd party buffering among other gains. If nothing else, it is worth experimenting with. Discussion on the topic is here: http://mail.python.org/pipermail/python-ideas/2010-September

[issue9971] Optimize BufferedReader.readinto

2011-05-10 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: No problem for me either way. I created issue12053 to track that. - John O'Connor On Tue, May 10, 2011 at 3:19 PM, Antoine Pitrou rep...@bugs.python.orgwrote: Antoine Pitrou pit...@free.fr added the comment: Also, while we're

[issue12049] expose RAND_bytes() function of OpenSSL

2011-05-10 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12049 ___ ___ Python-bugs-list mailing

[issue9971] Optimize BufferedReader.readinto

2011-05-10 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: Removed file: http://bugs.python.org/file21957/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971

[issue9971] Optimize BufferedReader.readinto

2011-05-08 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: I experimented with a bunch of different options. All benchmarks performed with: $ for i in 1 4 128 256 1024 2048 4069 8192; do echo -n buffer_size=${i} ; ./python -m timeit -s f=open('LICENSE','rb');b=bytearray(${i}) \ f.seek(0) while

[issue9971] Optimize BufferedReader.readinto

2011-05-08 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: Added file: http://bugs.python.org/file21941/issue9971-like-java.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971

[issue12021] mmap.read requires an argument

2011-05-07 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12021 ___ ___ Python-bugs-list mailing

[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: It seems to me that the point of using readinto() is to avoid double-buffering (and the extra alloc/free that comes with read()). The slowness of using a small buffer size seems like only a natural and expected consequence. The trade-off

[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: FWIW, It seems Java does something similar. They write directly into caller's buffer if outstanding bytes needed (after emptying internal buffer) is greater than internal buffer len. -- ___ Python

[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: Removed file: http://bugs.python.org/file21899/buffered_readinto.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971

[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: Removed file: http://bugs.python.org/file21900/buffered_readinto2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971

[issue9971] Optimize BufferedReader.readinto

2011-05-06 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: Good catch. v3 attached. -- Added file: http://bugs.python.org/file21912/buffered_readinto3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971

[issue9971] Optimize BufferedReader.readinto

2011-05-05 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: Attached patch draft for buffered_readinto(). patchcheck removed some whitespace as well. Daniel, I agree. BufferedReader.readinto seemingly defeats the purpose of using a BufferedReader to begin with. Though, for the difference Antoine

[issue9971] Optimize BufferedReader.readinto

2011-05-05 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: Thanks for the feedback. I made the changes, PTAL. -- Added file: http://bugs.python.org/file21900/buffered_readinto2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9971

[issue1677872] Efficient reverse line iterator

2011-05-05 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1677872 ___ ___ Python-bugs-list mailing

[issue9971] Optimize BufferedReader.readinto

2011-05-04 Thread John O'Connor
John O'Connor tehj...@gmail.com added the comment: I am new to the community but hoping to start contributing or at least following issues and learning :) I'm looking at bufferediobase_readinto(). What I haven't yet figured out is why .readinto() is (currently) implemented at this layer