|
|
@ -153,10 +153,8 @@ public class ProtoBenchCaliper { |
|
|
|
@Benchmark |
|
|
|
@Benchmark |
|
|
|
void deserializeFromByteString(int reps) throws IOException { |
|
|
|
void deserializeFromByteString(int reps) throws IOException { |
|
|
|
for (int i = 0; i < reps; i++) { |
|
|
|
for (int i = 0; i < reps; i++) { |
|
|
|
defaultMessage |
|
|
|
benchmarkMessageType.getDefaultInstance().getParserForType().parseFrom( |
|
|
|
.newBuilderForType() |
|
|
|
inputStringList.get((int) (counter % inputStringList.size())), extensions); |
|
|
|
.mergeFrom(inputStringList.get((int) (counter % inputStringList.size())), extensions) |
|
|
|
|
|
|
|
.build(); |
|
|
|
|
|
|
|
counter++; |
|
|
|
counter++; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -164,10 +162,8 @@ public class ProtoBenchCaliper { |
|
|
|
@Benchmark |
|
|
|
@Benchmark |
|
|
|
void deserializeFromByteArray(int reps) throws IOException { |
|
|
|
void deserializeFromByteArray(int reps) throws IOException { |
|
|
|
for (int i = 0; i < reps; i++) { |
|
|
|
for (int i = 0; i < reps; i++) { |
|
|
|
defaultMessage |
|
|
|
benchmarkMessageType.getDefaultInstance().getParserForType().parseFrom( |
|
|
|
.newBuilderForType() |
|
|
|
inputDataList.get((int) (counter % inputDataList.size())), extensions); |
|
|
|
.mergeFrom(inputDataList.get((int) (counter % inputDataList.size())), extensions) |
|
|
|
|
|
|
|
.build(); |
|
|
|
|
|
|
|
counter++; |
|
|
|
counter++; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -175,10 +171,8 @@ public class ProtoBenchCaliper { |
|
|
|
@Benchmark |
|
|
|
@Benchmark |
|
|
|
void deserializeFromMemoryStream(int reps) throws IOException { |
|
|
|
void deserializeFromMemoryStream(int reps) throws IOException { |
|
|
|
for (int i = 0; i < reps; i++) { |
|
|
|
for (int i = 0; i < reps; i++) { |
|
|
|
defaultMessage |
|
|
|
benchmarkMessageType.getDefaultInstance().getParserForType().parseFrom( |
|
|
|
.newBuilderForType() |
|
|
|
inputStreamList.get((int) (counter % inputStreamList.size())), extensions); |
|
|
|
.mergeFrom(inputStreamList.get((int) (counter % inputStreamList.size())), extensions) |
|
|
|
|
|
|
|
.build(); |
|
|
|
|
|
|
|
inputStreamList.get((int) (counter % inputStreamList.size())).reset(); |
|
|
|
inputStreamList.get((int) (counter % inputStreamList.size())).reset(); |
|
|
|
counter++; |
|
|
|
counter++; |
|
|
|
} |
|
|
|
} |
|
|
|