[issue13570] Expose faster unicode<->ascii functions in the C-API

2011-12-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: > But if I understand correctly, the slowdown in string formatting is > expected, so we can indeed close this. Well, expected doesn't mean it shouldn't be improved, so finding a way to speed it up would be nice ;) (probably difficult, though) -- nosy:

[issue13570] Expose faster unicode<->ascii functions in the C-API

2011-12-11 Thread Stefan Krah
Stefan Krah added the comment: Sorry, the title of the issue isn't correct any more. The revised issue is that in 3.3 a) outfil.write("%s\n" % t) is about 11% slower than in Python2.7 and 8% slower than in Python3.2. On the other hand in 3.3 the hack b) outfil.write(str(t)); outfil.write('\

[issue13570] Expose faster unicode<->ascii functions in the C-API

2011-12-11 Thread Martin v . Löwis
Martin v. Löwis added the comment: It's reasonable that string % formatting might have become slower... I wonder what the issue is at this point. Unless you can state a clear issue that you want to see resolved, I propose to close this report as invalid. -- __

[issue13570] Expose faster unicode<->ascii functions in the C-API

2011-12-10 Thread Stefan Krah
Stefan Krah added the comment: > I prefer to not expose such function or someone will use it without > understanding exactly how dangerous it is. OK. - I'm afraid that I made an error in the benchmarks, since I accidentally used a changed version of telco.py, namely: # t is a Decimal o

[issue13570] Expose faster unicode<->ascii functions in the C-API

2011-12-10 Thread STINNER Victor
STINNER Victor added the comment: Le 09/12/2011 22:12, Stefan Krah a écrit : > The bottleneck in _decimal is (res is ascii): > > PyUnicode_FromString(res); > > PyUnicode_DecodeASCII(res) has the same performance. > > > With this function ... > >static PyObject* > unicode_fromascii(const

[issue13570] Expose faster unicode<->ascii functions in the C-API

2011-12-09 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13570] Expose faster unicode<->ascii functions in the C-API

2011-12-09 Thread Stefan Krah
New submission from Stefan Krah : I just ran the telco benchmark ... http://www.bytereef.org/mpdecimal/quickstart.html#telco-benchmark ... on _decimal to see how the PEP-393 changes affect the module. The benchmark reads numbers from a binary file, does some calculations and prints the result