Message79432
Antoine Pitrou wrote:
> Antoine Pitrou <pitrou@free.fr> added the comment:
>
> Attached patch adds acceleration for latin1 and utf16 decoding as well.
>
> All three codecs (utf8, utf16, latin1) are now in the same ballpark
> performance-wise on favorable input: on my machine, they are able to
> decode at almost 1GB/s.
>
> (unpatched, it is between 150 and 500MB/s. depending on the codec)
>
> Added file: http://bugs.python.org/file12655/decode5.patch
A few style comments:
* please use indented #pre-processor directives whenever possible, e.g.
#if
# define
#else
# define
#endif
* the conditions should only accept SIZE_OF_LONG == 4 and 8 and
fail with an #error for any other value
* you should use unsigned longs instead of signed ones
* please use spaces around arithmetic operators, e.g. not a+b, but
a + b
* when calling functions with lots of parameters, put each parameter on
a new line (e.g. for unicode_decode_call_errorhandler())
Please also add a comment somewhere to the bit masks explaining what
they do and how they are used. Verbose comments are always good to
have when doing optimizations such as these. Have a look at the
dictionary implementation for what I mean by this.
Thanks,
--
Marc-Andre Lemburg
eGenix.com
________________________________________________________________________
::: Try our new mxODBC.Connect Python Database Interface for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/ |
|
Date |
User |
Action |
Args |
2009-01-08 19:37:38 | lemburg | set | recipients:
+ lemburg, loewis, amaury.forgeotdarc, pitrou, kevinwatters |
2009-01-08 19:37:37 | lemburg | link | issue4868 messages |
2009-01-08 19:37:37 | lemburg | create | |
|