[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: "FYI, https://github.com/python/performance/pull/27 will fix performance regression. Python 3 performance is similar to Python 2 after s/warn/warning/" I was surprised to see that Logger.warn() is slower than Logger.warning()! It is because warn() emits a depr

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread Bhavishya
Bhavishya added the comment: I'm running archlinux(on mac...not very confident of my system though I tried cpu isolation with "isolcpus") so if please anyone else also can run itand confirm if it actually helps. Thanks. On Fri, Jun 30, 2017 at 7:03 PM, INADA Naoki wrote: > > INADA Naoki ad

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread INADA Naoki
INADA Naoki added the comment: FYI, https://github.com/python/performance/pull/27 will fix performance regression. Python 3 performance is similar to Python 2 after s/warn/warning/ -- ___ Python tracker __

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: > I rewrote my old benchmarks using the new perf module API: bench_stringio3.py. WTF? The file is not attached to this issue, but I removed it locally :-( It seems like Roundup cleared the file field of this form when I got a conflict when I wanted to post my

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread INADA Naoki
INADA Naoki added the comment: I'm sorry, it's my mistake. I used vmprof on mac and I thought as_ucs4 is bottleneck. But vmprof on Linux (and perf) shows totally different result. Maybe, current vmprof doesn't work well for native code on macOS. -- resolution: -> not a bug stage: ->

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: According to my result computed 5 times ago, the most signicant different was on *reading* from StringIO which contains USC1 text: reader long lines ascii | 103 us (*) | 33.4 us (-68%) reader long lines latin1 | 105 us (*) | 34.2 us

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: I rewrote my old benchmarks using the new perf module API: bench_stringio3.py. This benchmark suite now takes forever with perf, since perf computes much more values and the suite contains a total of 108 benchmarks! Most lines should be commented to take a rea

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread Bhavishya
Changes by Bhavishya : -- nosy: +bhavishya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread STINNER Victor
STINNER Victor added the comment: There was a discussion to use an adaptative implementation depending *how* the API is used. Write only is different than write, seek back, write, read, seek, etc. The idea was used unicode writer when it's the most efficient, write only, and switch to somethi

[issue30815] StringIO uses inefficient PyUnicode_AsUCS4

2017-06-30 Thread INADA Naoki
New submission from INADA Naoki: >From PEP393, PyUnicode_AsUCS4 is inefficient. And C implementation of io.StringIO() uses it. That's why Python 3 is slower than Python 2 on logging_format and logging_simple benchmarks. https://mail.python.org/pipermail/speed/2017-February/000503.html Maybe, i