[MERGE] rand_chars() optimization

Dmitry Vasiliev dima at hlabs.spb.ru
Sun Mar 11 12:43:59 GMT 2007


The attached patch makes osutils.rand_chars() faster by precompiling 
characters mapping and also adds test for uniqueness and benchmark.

The benchmark results on my system as following:

  - Old version: 8437ms/8827ms
  - New version: 5844ms/6219ms

So the new version is more than 30% faster.

I guess precompilation overhead is not so big so I haven't added 'on 
demand' precompilation for now but it's not so hard to do if it will be 
needed.

-- 
Dmitry Vasiliev <dima at hlabs.spb.ru>
http://hlabs.spb.ru
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rand_chars.bundle
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20070311/6b1db539/attachment.diff 


More information about the bazaar mailing list