Add more benchmarks for various conversions
Summary: This adds a couple of new benchmarks that will be used as a basis to check the performance of a series of upcoming changes to folly::to<>. It exercises both successful and unsuccessful conversion paths for string-to-anything, int-to-int, int-to-float, float-to-int, and pair- of-pointers-to-int conversions. The following table only shows the newly added benchmarks: ============================================================== folly/test/ConvBenchmark.cpp time/iter iters/s ============================================================== stringToBoolNumClassic 12.76ns 78.37M stringToBoolNumClassicError 3.19us 313.37K stringToBoolStrClassic 17.92ns 55.79M stringToBoolStrClassicError 3.21us 311.73K -------------------------------------------------------------- stringToFloatNumClassic 32.96ns 30.34M stringToFloatNumClassicError 2.73us 366.49K stringToFloatStrClassic 37.37ns 26.76M stringToFloatStrClassicError 2.87us 348.81K stringToDoubleNumClassic 31.30ns 31.95M stringToDoubleNumClassicError 2.69us 371.26K stringToDoubleStrClassic 37.67ns 26.54M stringToDoubleStrClassicError 2.87us 348.97K -------------------------------------------------------------- stringToCharSignedClassic 16.71ns 59.85M stringToCharSignedClassicError 3.87us 258.50K stringToCharUnsignedClassic 15.49ns 64.54M stringToCharUnsignedClassicError 2.73us 366.88K stringToIntSignedClassic 21.26ns 47.03M stringToIntSignedClassicError 3.94us 253.82K stringToIntUnsignedClassic 17.93ns 55.79M stringToIntUnsignedClassicError 2.72us 367.93K stringToLongLongSignedClassic 34.63ns 28.88M stringToLongLongSignedClassicError 3.94us 253.52K stringToLongLongUnsignedClassic 51.04ns 19.59M stringToLongLongUnsignedClassicError 2.73us 366.58K -------------------------------------------------------------- ptrPairToCharSignedClassic 5.16ns 193.62M ptrPairToCharSignedClassicError 3.56us 280.99K ptrPairToCharUnsignedClassic 2.43ns 411.44M ptrPairToCharUnsignedClassicError 2.63us 380.42K ptrPairToIntSignedClassic 6.99ns 143.09M ptrPairToIntSignedClassicError 4.08us 245.27K ptrPairToIntUnsignedClassic 4.25ns 235.09M ptrPairToIntUnsignedClassicError 2.70us 370.55K ptrPairToLongLongSignedClassic 12.16ns 82.27M ptrPairToLongLongSignedClassicError 4.06us 246.17K ptrPairToLongLongUnsignedClassic 29.13ns 34.33M ptrPairToLongLongUnsignedClassicError 2.71us 369.33K -------------------------------------------------------------- intToCharSignedClassic 405.02ps 2.47G intToCharSignedClassicError 2.10us 475.11K intToCharUnsignedClassic 303.79ps 3.29G intToCharUnsignedClassicError 2.10us 475.18K intToIntSignedClassic 405.02ps 2.47G intToIntSignedClassicError 1.99us 501.60K intToIntUnsignedClassic 405.03ps 2.47G intToIntUnsignedClassicError 2.09us 478.47K -------------------------------------------------------------- intToFloatClassic 545.11ps 1.83G intToFloatClassicError 1.67us 599.38K -------------------------------------------------------------- floatToFloatClassic 759.47ps 1.32G floatToFloatClassicError 6.45us 154.98K -------------------------------------------------------------- floatToIntClassic 637.82ps 1.57G floatToIntClassicError 1.92us 520.16K ============================================================== Reviewed By: yfeldblum Differential Revision: D3433745 fbshipit-source-id: 6ab1ede32c07e7fc29b982e8705ecc0138fa6384
Showing
Please register or sign in to comment