The Tests
Most of the tests have 8 variants. One with 5, 50, 500 and 5000 items to test scalability and int32 and BString versions where int32 are fixed size and BStrings variable.
Also there are two versions of the flatten / unflatten tests. The normal one has just 1 field with 5, 50, 500 or 5000 items. The individual ones have 5, 50, 500 or 5000 fields with 1 item each.
All times below are microseconds (usecs) and contain timing errors. Due to this these values should be looked at as indications and not facts.
All tests were conducted on a P4 3.0GHz with 512MB RAM running BeOS R5.
What is What
R5: Original R5 implementation
Message1: Current Haiku implementation
Message2: Second implementation in the SVN repository
Message3: Third implementation operating on a flat buffer
Message4: Flat buffer only, no fancy classes, just pure flat stuff
Winner: Fastest implementation
Haiku Winner: Fastest implementation available for Haiku
Results as of 20051031
| Test | R5 | Message1 | Message2 | Message3 | Message4 | Winner | Haiku Winner | |
| tCreate5Int32(): | 9 | 19 | 13 | 11 | 8 | Message4 | Message4 | |
| tCreate50Int32(): | 79 | 175 | 97 | 87 | 80 | R5 | Message4 | |
| tCreate500Int32(): | 903 | 2428 | 1002 | 1897 | 758 | Message4 | Message4 | |
| tCreate5000Int32(): | 7445 | 15005 | 11125 | 20373 | 7907 | R5 | Message4 | |
| tCreate5String(): | 8 | 24 | 13 | 14 | 12 | R5 | Message4 | |
| tCreate50String(): | 77 | 3282 | 109 | 120 | 82 | R5 | Message4 | |
| tCreate500String(): | 1118 | 1968 | 1079 | 1076 | 815 | Message4 | Message4 | |
| tCreate5000String(): | 8245 | 16740 | 12589 | 11516 | 8238 | Message4 | Message4 | |
| tLookup5Int32(): | 2 | 4 | 3 | 3 | 2 | - | Message4 | |
| tLookup50Int32(): | 2 | 3 | 2 | 2 | 2 | - | - | |
| tLookup500Int32(): | 2 | 3 | 3 | 3 | 2 | - | Message4 | |
| tLookup5000Int32(): | 2 | 3 | 4 | 4 | 4 | R5 | Message1 | |
| tRead5Int32(): | 8 | 12 | 8 | 10 | 7 | Message4 | Message4 | |
| tRead50Int32(): | 72 | 105 | 78 | 77 | 74 | R5 | Message4 | |
| tRead500Int32(): | 717 | 1498 | 2790 | 763 | 700 | Message4 | Message4 | |
| tRead5000Int32(): | 7852 | 10836 | 8810 | 9695 | 8505 | R5 | Message4 | |
| tRead5String(): | 9 | 12 | 11 | 8 | 9 | Message3 | Message3 | |
| tRead50String(): | 72 | 106 | 93 | 82 | 79 | R5 | Message4 | |
| tRead500String(): | 983 | 3489 | 1828 | 795 | 1163 | Message3 | Message3 | |
| tRead5000String(): | 61017 | 11154 | 9019 | 8272 | 65422 | Message3 | Message3 | |
| tFlatten5Int32(): | 5 | 14 | 9 | 8 | 4 | Message4 | Message4 | |
| tFlatten50Int32(): | 4 | 35 | 9 | 8 | 5 | R5 | Message4 | |
| tFlatten500Int32(): | 19 | 268 | 11 | 10 | 6 | Message4 | Message4 | |
| tFlatten5000Int32(): | 45 | 6324 | 25 | 52 | 51 | Message2 | Message2 | |
| tFlatten5String(): | 6 | 14 | 7 | 8 | 4 | Message4 | Message4 | |
| tFlatten50String(): | 5 | 40 | 11 | 10 | 13 | R5 | Message3 | |
| tFlatten500String(): | 21 | 863 | 16 | 29 | 15 | Message4 | Message4 | |
| tFlatten5000String(): | 172 | 2990 | 280 | 183 | 152 | Message4 | Message4 | |
| tFlattenIndividual5Int32(): | 7 | 17 | 9 | 8 | 4 | Message4 | Message4 | |
| tFlattenIndividual50Int32(): | 36 | 67 | 28 | 10 | 7 | Message4 | Message4 | |
| tFlattenIndividual500Int32(): | 326 | 661 | 288 | 27 | 20 | Message4 | Message4 | |
| tFlattenIndividual5000Int32(): | 3644 | 7582 | 3891 | 383 | 910 | Message3 | Message3 | |
| tFlattenIndividual5String(): | 8 | 19 | 11 | 9 | 4 | Message4 | Message4 | |
| tFlattenIndividual50String(): | 39 | 72 | 33 | 11 | 8 | Message4 | Message4 | |
| tFlattenIndividual500String(): | 382 | 944 | 383 | 66 | 64 | Message4 | Message4 | |
| tFlattenIndividual5000String(): | 4278 | 8498 | 4654 | 631 | 1094 | Message3 | Message3 | |
| tUnflatten5Int32(): | 6 | 29 | 11 | 529 | 4 | Message4 | Message4 | |
| tUnflatten50Int32(): | 5 | 109 | 9 | 10 | 4 | Message4 | Message4 | |
| tUnflatten500Int32(): | 22 | 809 | 11 | 21 | 17 | Message2 | Message2 | |
| tUnflatten5000Int32(): | 93 | 9828 | 68 | 73 | 49 | Message4 | Message4 | |
| tUnflatten5String(): | 5 | 27 | 8 | 9 | 5 | - | Message4 | |
| tUnflatten50String(): | 7 | 102 | 10 | 25 | 5 | Message4 | Message4 | |
| tUnflatten500String(): | 18 | 1154 | 30 | 123 | 9 | Message4 | Message4 | |
| tUnflatten5000String(): | 486 | 9188 | 331 | 1501 | 210 | Message4 | Message4 | |
| tUnflattenIndividual5Int32(): | 7 | 37 | 15 | 12 | 5 | Message4 | Message4 | |
| tUnflattenIndividual50Int32(): | 35 | 269 | 89 | 38 | 16 | Message4 | Message4 | |
| tUnflattenIndividual500Int32(): | 266 | 3324 | 2354 | 306 | 50 | Message4 | Message4 | |
| tUnflattenIndividual5000Int32(): | 4402 | 35387 | 7751 | 4654 | 634 | Message4 | Message4 | |
| tUnflattenIndividual5String(): | 31 | 41 | 19 | 14 | 32 | Message3 | Message3 | |
| tUnflattenIndividual50String(): | 46 | 261 | 95 | 62 | 16 | Message4 | Message4 | |
| tUnflattenIndividual500String(): | 538 | 3705 | 809 | 955 | 64 | Message4 | Message4 | |
| tUnflattenIndividual5000String(): | 9464 | 36494 | 7964 | 5174 | 753 | Message4 | Message4 | |