[mnet-devel] that last optimization of fast-dump algorithms
Zooko
zooko at zooko.com
Sat Aug 9 18:53:21 BST 2003
I optimized dump-to-mencode-format:
cstringdictdumpsmencode
N: 16384, time: ave: 0.04, 5th-best: 0.04, 5th-worst: 0.04 (of 128), ave rate: 442557
N: 65536, time: ave: 0.15, 5th-best: 0.15, 5th-worst: 0.16 (of 128), ave rate: 437274
N: 262144, time: ave: 0.61, 5th-best: 0.59, 5th-worst: 0.63 (of 99), ave rate: 432090
N: 1048576, time: ave: 2.46, 4th-best: 2.43, 4th-worst: 2.50 (of 25), ave rate: 425408
cstringdictdumpsmencode2
N: 16384, time: ave: 0.01, 5th-best: 0.01, 5th-worst: 0.01 (of 128), ave rate: 1106503
N: 65536, time: ave: 0.06, 5th-best: 0.06, 5th-worst: 0.06 (of 128), ave rate: 1073200
N: 262144, time: ave: 0.25, 5th-best: 0.25, 5th-worst: 0.27 (of 128), ave rate: 1039681
N: 1048576, time: ave: 1.05, 5th-best: 1.04, 5th-worst: 1.07 (of 57), ave rate: 995169
Uh-oh. I just realized that mencoding format requires that the strings in a
dict be *sorted*. That probably accounts for much of the discrepancy between
mencode and c-fast-mencode-format. Here is the discrepancy I mean:
cfastdumpermencode
N: 1048576, time: ave: 3.73, 3th-best: 3.69, 3th-worst: 3.73 (of 17), ave rate: 280825
mencode
N: 1048576, time: ave: 16.04, 4th-best: 15.96, 4th-worst: 16.09 (of 50), ave rate: 65383
Well, I don't want to go implement sorting-of-keys in c-fast-dump-to-mencode
format, nor do I want to fix the other bugs that I just noticed in in c-fast-
dump-to-mencode format. I've had enough optimization fun for now.
If anyone were actually going to use this for anything, I would recommend
using C-fast-dump-to-minimal-binary-format:
cstringdictdumps
N: 1048576, time: ave: 0.90, 5th-best: 0.89, 5th-worst: 0.92 (of 67), ave rate: 1162015
--Z
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
mnet-devel mailing list
mnet-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mnet-devel
More information about the Mnet-devel
mailing list