[issue12911] Expose a private accumulator C API

2011-09-16 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue12911> ___ ___ Python-bugs-list mailing list Unsubsc

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

2011-10-01 Thread John O'Connor
New submission from John O'Connor : 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 for the seekable streams b

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

2011-10-01 Thread John O'Connor
John O'Connor 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,unicod

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

2011-10-03 Thread John O'Connor
John O'Connor 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 are exhausted. I

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

2011-10-11 Thread John O'Connor
John O'Connor 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 <http://bugs.python.org/is

[issue12807] Move strip() to stringlib

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

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

2011-10-12 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue13150> ___ ___ Python-bugs-list mailing list Unsubsc

[issue13217] Missing header dependencies in Makefile

2011-10-18 Thread John O'Connor
New submission from John O'Connor : 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, pitrou pri

[issue13521] Make dict.setdefault() atomic

2011-12-09 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue13521> ___ ___ Python-bugs-list mailing list Unsubsc

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

2011-05-28 Thread John O'Connor
John O'Connor 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 think.

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

2011-05-28 Thread John O'Connor
Changes by John O'Connor : Added file: http://bugs.python.org/file22169/issue12053-tests.patch ___ Python tracker <http://bugs.python.org/issue12053> ___ ___ Pytho

[issue12229] Remove unused variable in bufferedio.c

2011-05-31 Thread John O'Connor
New submission from John O'Connor : 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: Remove u

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

2011-05-31 Thread John O'Connor
John O'Connor 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 `read

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

2011-05-31 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue1152248> ___ ___ Python-bugs-list mailing list Unsubsc

[issue11197] information leakage with SimpleHTTPServer

2011-05-31 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue11197> ___ ___ Python-bugs-list mailing list Unsubsc

[issue8578] PyWeakref_GetObject

2011-05-31 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue8578> ___ ___ Python-bugs-list mailing list Unsubsc

[issue10399] AST Optimization: inlining of function calls

2011-05-31 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue10399> ___ ___ Python-bugs-list mailing list Unsubsc

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

2011-06-01 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue9858> ___ ___ Python-bugs-list mailing list Unsubsc

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

2011-06-05 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue12268> ___ ___ Python-bugs-list mailing list Unsubsc

[issue5231] Change format of a memoryview

2011-06-20 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue5231> ___ ___ Python-bugs-list mailing list Unsubsc

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

2011-06-20 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue10181> ___ ___ Python-bugs-list mailing list Unsubsc

[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 : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue11549> ___ ___ Python-bugs-list mailing list Unsubsc

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

2011-08-21 Thread John O'Connor
New submission from John O'Connor : 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 also be ap

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

2011-08-21 Thread John O'Connor
Changes by John O'Connor : -- title: Optimzations for bytes.join() et. al -> Optimizations for bytes.join() et. al ___ Python tracker <http://bugs.python.org

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

2011-08-21 Thread John O'Connor
New submission from John O'Connor : 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 Looking at jus

[issue10408] Denser dicts and linear probing

2011-08-23 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue10408> ___ ___ Python-bugs-list mailing list Unsubsc

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

2011-08-24 Thread John O'Connor
John O'Connor 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 : Removed file: http://bugs.python.org/file23040/unnamed ___ Python tracker <http://bugs.python.org/issue12807> ___ ___ Python-bugs-list m

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

2011-08-24 Thread John O'Connor
John O'Connor added the comment: Antoine Pitrou 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 in particular

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

2011-09-09 Thread John O'Connor
John O'Connor 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 see no delt

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

2011-09-09 Thread John O'Connor
Changes by John O'Connor : Removed file: http://bugs.python.org/file22982/strip_perf.patch ___ Python tracker <http://bugs.python.org/issue12807> ___ ___ Pytho

[issue9971] Optimize BufferedReader.readinto

2011-05-04 Thread John O'Connor
John O'Connor 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 of the

[issue9971] Optimize BufferedReader.readinto

2011-05-05 Thread John O'Connor
John O'Connor 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 pointed out it

[issue9971] Optimize BufferedReader.readinto

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

[issue1677872] Efficient reverse line iterator

2011-05-05 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue1677872> ___ ___ Python-bugs-list mailing list Unsubsc

[issue9971] Optimize BufferedReader.readinto

2011-05-06 Thread John O'Connor
John O'Connor added the comment: Good catch. v3 attached. -- Added file: http://bugs.python.org/file21912/buffered_readinto3.patch ___ Python tracker <http://bugs.python.org/i

[issue12021] mmap.read requires an argument

2011-05-07 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue12021> ___ ___ Python-bugs-list mailing list Unsubsc

[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor
John O'Connor 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 of accommodat

[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor
John O'Connor 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 trac

[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor
Changes by John O'Connor : Removed file: http://bugs.python.org/file21899/buffered_readinto.patch ___ Python tracker <http://bugs.python.org/issue9971> ___ ___ Pytho

[issue9971] Optimize BufferedReader.readinto

2011-05-07 Thread John O'Connor
Changes by John O'Connor : Removed file: http://bugs.python.org/file21900/buffered_readinto2.patch ___ Python tracker <http://bugs.python.org/issue9971> ___ ___ Pytho

[issue9971] Optimize BufferedReader.readinto

2011-05-08 Thread John O'Connor
John O'Connor 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(

[issue9971] Optimize BufferedReader.readinto

2011-05-08 Thread John O'Connor
Changes by John O'Connor : Added file: http://bugs.python.org/file21941/issue9971-like-java.patch ___ Python tracker <http://bugs.python.org/issue9971> ___ ___ Pytho

[issue9971] Optimize BufferedReader.readinto

2011-05-10 Thread John O'Connor
John O'Connor 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 no problem changi

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

2011-05-10 Thread John O'Connor
New submission from John O'Connor : 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/008180.ht

[issue9971] Optimize BufferedReader.readinto

2011-05-10 Thread John O'Connor
John O'Connor 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 wrote: > > Antoine Pitrou added the comment: > > > Also, while we're at it, would it be wor

[issue12049] expose RAND_bytes() function of OpenSSL

2011-05-10 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue12049> ___ ___ Python-bugs-list mailing list Unsubsc

[issue9971] Optimize BufferedReader.readinto

2011-05-10 Thread John O'Connor
Changes by John O'Connor : Removed file: http://bugs.python.org/file21957/unnamed ___ Python tracker <http://bugs.python.org/issue9971> ___ ___ Python-bugs-list m

[issue9971] Optimize BufferedReader.readinto

2011-05-11 Thread John O'Connor
John O'Connor 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)&qu

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

2011-05-12 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue12062> ___ ___ Python-bugs-list mailing list Unsubsc

[issue13903] New shared-keys dictionary implementation

2012-01-29 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue13903> ___ ___ Python-bugs-list mailing list Unsubsc

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

2012-07-17 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue15381> ___ ___ Python-bugs-list mailing list Unsubsc

[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 <http://bugs.python.o

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

2013-01-09 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue16398> ___ ___ Python-bugs-list mailing list Unsubsc

[issue16465] dict creation performance regression

2013-01-09 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue16465> ___ ___ Python-bugs-list mailing list Unsubsc

[issue1508475] transparent gzip compression in urllib

2013-01-09 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue1508475> ___ ___ Python-bugs-list mailing list Unsubsc

[issue11695] Improve argparse usage/help customization

2013-01-09 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue11695> ___ ___ Python-bugs-list mailing list Unsubsc

[issue16445] SEGFAULT when deleting Exception.message

2013-01-09 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue16445> ___ ___ Python-bugs-list mailing list Unsubsc

[issue15948] Unchecked return value of I/O functions

2013-01-09 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue15948> ___ ___ Python-bugs-list mailing list Unsubsc

[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 conca

[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 <http://bugs.py

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

2016-03-22 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker <http://bugs.python.org/issue21423> ___ ___ Python-bugs-list mailing list Unsubscr