Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
producer_worker
: revert use of ValueGenerator::Generate()
Using the modified `Generate()` function was a lot slower than just simply making an empty payload: ``` Benchmark_random_payload10-32 2445903 485.2 ns/op Benchmark_random_payload100-32 678870 1773 ns/op Benchmark_random_payload1000-32 105667 13700 ns/op Benchmark_random_payload1e4-32 9104 126782 ns/op Benchmark_random_payload1e5-32 1135 1151425 ns/op Benchmark_random_payload1e6-32 100 13046547 ns/op ========================================================== Benchmark_empty_payload10-32 79950942 20.54 ns/op Benchmark_empty_payload100-32 24089101 54.78 ns/op Benchmark_empty_payload1000-32 3789248 366.1 ns/op Benchmark_empty_payload1e4-32 670096 2059 ns/op Benchmark_empty_payload1e5-32 58912 23021 ns/op Benchmark_empty_payload1e6-32 5600 290045 ns/op ``` As can be seen, generating the random payload and ensuring it is UTF-8 valid is orders of magnitude slower than the empty payload. Revert the use of `Generate()` here in place of the empty payload. However, if the user has indicated they want to validate the latest key-value pair produced, generate a `(value-{%018d}, offset)` message in the record. This does mean that message sizes that are less than 24 bytes are not honored if the `validate-latest-values` flag is passed.
- Loading branch information