Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue12911>
___
___
Python-bugs-list mailing list
Unsubsc
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
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
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
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
Changes by John O'Connor :
--
title: Optimization/refactoring for {bytearray, bytes, unicode}.strip() -> Move
strip() to stringlib
___
Python tracker
<http://bugs.python.org
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue13150>
___
___
Python-bugs-list mailing list
Unsubsc
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue13521>
___
___
Python-bugs-list mailing list
Unsubsc
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.
Changes by John O'Connor :
Added file: http://bugs.python.org/file22169/issue12053-tests.patch
___
Python tracker
<http://bugs.python.org/issue12053>
___
___
Pytho
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
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue1152248>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue11197>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue8578>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue10399>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue9858>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue12268>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue5231>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue10181>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue11549>
___
___
Python-bugs-list mailing list
Unsubsc
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
Changes by John O'Connor :
--
title: Optimzations for bytes.join() et. al -> Optimizations for bytes.join()
et. al
___
Python tracker
<http://bugs.python.org
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue10408>
___
___
Python-bugs-list mailing list
Unsubsc
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
Changes by John O'Connor :
Removed file: http://bugs.python.org/file23040/unnamed
___
Python tracker
<http://bugs.python.org/issue12807>
___
___
Python-bugs-list m
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
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
Changes by John O'Connor :
Removed file: http://bugs.python.org/file22982/strip_perf.patch
___
Python tracker
<http://bugs.python.org/issue12807>
___
___
Pytho
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
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
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue1677872>
___
___
Python-bugs-list mailing list
Unsubsc
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue12021>
___
___
Python-bugs-list mailing list
Unsubsc
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
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
Changes by John O'Connor :
Removed file: http://bugs.python.org/file21899/buffered_readinto.patch
___
Python tracker
<http://bugs.python.org/issue9971>
___
___
Pytho
Changes by John O'Connor :
Removed file: http://bugs.python.org/file21900/buffered_readinto2.patch
___
Python tracker
<http://bugs.python.org/issue9971>
___
___
Pytho
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(
Changes by John O'Connor :
Added file: http://bugs.python.org/file21941/issue9971-like-java.patch
___
Python tracker
<http://bugs.python.org/issue9971>
___
___
Pytho
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
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
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue12049>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
Removed file: http://bugs.python.org/file21957/unnamed
___
Python tracker
<http://bugs.python.org/issue9971>
___
___
Python-bugs-list m
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue12062>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue15381>
___
___
Python-bugs-list mailing list
Unsubsc
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue16398>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue16465>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue1508475>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue11695>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue16445>
___
___
Python-bugs-list mailing list
Unsubsc
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue15948>
___
___
Python-bugs-list mailing list
Unsubsc
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
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
Changes by John O'Connor :
--
nosy: +jcon
___
Python tracker
<http://bugs.python.org/issue21423>
___
___
Python-bugs-list mailing list
Unsubscr
62 matches
Mail list logo