You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/02/04 03:00:41 UTC
[GitHub] [kafka] dengziming edited a comment on pull request #10031: KAFKA-12269: Replace partition metada with auto-generated protocal
dengziming edited a comment on pull request #10031:
URL: https://github.com/apache/kafka/pull/10031#issuecomment-772989696
@ijuma Thank you for you comment, I found that there wasn't a benchmark for `MetadataResponse`, so I added a `MetadataResponseBenchmark` and use it to test the perf, below is the report:
**BEFORE**
```
Benchmark (partitionCount) (topicCount) Mode Cnt Score Error Units
MetadataResponseBenchmark.constructMetadataResponse 10 500 avgt 15 344284.095 ± 13259.338 ns/op
MetadataResponseBenchmark.constructMetadataResponse 10 1000 avgt 15 718573.358 ± 63996.050 ns/op
MetadataResponseBenchmark.constructMetadataResponse 10 5000 avgt 15 4870090.616 ± 451297.425 ns/op
MetadataResponseBenchmark.constructMetadataResponse 20 500 avgt 15 803109.841 ± 52494.318 ns/op
MetadataResponseBenchmark.constructMetadataResponse 20 1000 avgt 15 1777856.958 ± 469373.020 ns/op
MetadataResponseBenchmark.constructMetadataResponse 20 5000 avgt 15 12240234.867 ± 567037.825 ns/op
MetadataResponseBenchmark.constructMetadataResponse 50 500 avgt 15 1890487.202 ± 134751.636 ns/op
MetadataResponseBenchmark.constructMetadataResponse 50 1000 avgt 15 4334346.074 ± 397626.252 ns/op
MetadataResponseBenchmark.constructMetadataResponse 50 5000 avgt 15 28282426.412 ± 2651334.032 ns/op
```
**AFTER**
```
Benchmark (partitionCount) (topicCount) Mode Cnt Score Error Units
MetadataResponseBenchmark.constructMetadataResponse 10 500 avgt 15 35581.112 ± 8551.477 ns/op
MetadataResponseBenchmark.constructMetadataResponse 10 1000 avgt 15 48961.954 ± 5164.636 ns/op
MetadataResponseBenchmark.constructMetadataResponse 10 5000 avgt 15 281938.520 ± 33707.495 ns/op
MetadataResponseBenchmark.constructMetadataResponse 20 500 avgt 15 25014.874 ± 3867.613 ns/op
MetadataResponseBenchmark.constructMetadataResponse 20 1000 avgt 15 48173.568 ± 4948.323 ns/op
MetadataResponseBenchmark.constructMetadataResponse 20 5000 avgt 15 297381.920 ± 69167.985 ns/op
MetadataResponseBenchmark.constructMetadataResponse 50 500 avgt 15 32353.354 ± 4828.446 ns/op
MetadataResponseBenchmark.constructMetadataResponse 50 1000 avgt 15 49297.824 ± 6587.378 ns/op
MetadataResponseBenchmark.constructMetadataResponse 50 5000 avgt 15 292526.745 ± 36390.834 ns/op
```
In short, this pr brings no perf regression, and improve the perf tremendously otherwise. this is reasonable since we use `MetadataResponseData.MetadataResponsePartition` directly instead of transforming it into `MetadataResponse.PartitionMetadata` before using.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org