DescriptionImprove base::RandBytes() performance by 1.75x-2.10x on POSIX.
No real changes, just avoids doling out Uint64 sized chunks by
using the underlying method to hand out correctly sized blocks.
Windows is the only platform which doesn't have a byte stream
based generator, so I've moved the generic RandBytes() method
there and added native methods for other platforms which reuse
each platforms internal generator.
Performance measured by the new benchmark test over 5 runs,
each representing 10 generations of 1mb of random data:
Linux x64:
Original: 1199625.4
Modified: 686480.2
Improvement: 1.75x
On OSX (10.9.1):
Original: 1532669.8
Modified: 734808.0
Improvement: 2.10x
BUG=none
TEST=new benchmark unittest.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=246486
Patch Set 1 #Patch Set 2 : Fix NaCl uint32 boundary. #Patch Set 3 : Cleanup style. Const. #
Total comments: 2
Patch Set 4 : Comments. Simplify. #Patch Set 5 : Simplify NaCl. #
Total comments: 16
Patch Set 6 : Comments. #
Messages
Total messages: 22 (0 generated)
|