[PATCH] utf-8 encoder/decoder optimizations
John Arbash Meinel
john at arbash-meinel.com
Fri Nov 24 19:09:47 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dmitry Vasiliev wrote:
>
> The attached patch use previously looked up encoder/decoder instead of
> the string/unicode methods for utf-8 encoding/decoding, which is almost
> 2 times faster (benchmarked by timeit module).
+1 from me, though probably not until 0.14 is opened up next week.
As another test, you could run:
bzr selftest --benchmarks 'cache_utf8.*cached'
Which should also show the difference in encoding/decoding time. On my
laptop, I don't see much of a difference. Probably because the majority
of the time is spent in doing dictionary lookups. One thing that might
be interesting, would be to write a 1M_by_1 test, which creates 1M
revision ids, and then encodes / decodes all of them. That would
probably show the improvement for this change.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFZ0N7JdeBCYSNAAMRAnlhAJ9jKvzyD2jWjx59GkMDLPxWYR4l4gCgpHHK
jo0xb/jkSH132PgW9W2WV4M=
=KOVM
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list