| 1228 | } |
| 1229 | |
| 1230 | void BM_ReadString(int n, int len) { |
| 1231 | testing::StopTiming(); |
| 1232 | random::PhiloxRandom philox(301, 17); |
| 1233 | random::SimplePhilox rnd(&philox); |
| 1234 | string x; |
| 1235 | for (int i = 0; i < len; i++) { |
| 1236 | x += rnd.Uniform(256); |
| 1237 | } |
| 1238 | string data; |
| 1239 | OCWriteToString<string>(&data, x); |
| 1240 | string result; |
| 1241 | |
| 1242 | testing::BytesProcessed(n * len); |
| 1243 | testing::StartTiming(); |
| 1244 | while (n-- > 0) { |
| 1245 | result.clear(); |
| 1246 | StringPiece s = data; |
| 1247 | OCRead<string>(&s, &result); |
| 1248 | } |
| 1249 | } |
| 1250 | |
| 1251 | void BM_WriteStringIncreasing(int n, int len) { BM_WriteString(n, len); } |
| 1252 | void BM_ReadStringIncreasing(int n, int len) { BM_ReadString(n, len); } |
no test coverage detected