diff options
author | Taras Voinarovskyi <voyn1991@gmail.com> | 2017-10-25 07:28:35 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-25 07:28:35 +0900 |
commit | 8b05ee8da50b4c7b832676f4e38f9d92a86639cc (patch) | |
tree | 91fe16e3c9aff44ca93633824b96da4b8ff19384 /benchmarks/record_batch_read.py | |
parent | 4213d53d4ccfd239addc1db07b5b3913b4c6547c (diff) | |
download | kafka-python-8b05ee8da50b4c7b832676f4e38f9d92a86639cc.tar.gz |
Add DefaultRecordBatch implementation aka V2 message format parser/builder. (#1185)
Added bytecode optimization for varint and append/read_msg functions. Mostly based on avoiding LOAD_GLOBAL calls.
Diffstat (limited to 'benchmarks/record_batch_read.py')
-rw-r--r-- | benchmarks/record_batch_read.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/benchmarks/record_batch_read.py b/benchmarks/record_batch_read.py index 7ae471e..fc01e42 100644 --- a/benchmarks/record_batch_read.py +++ b/benchmarks/record_batch_read.py @@ -35,7 +35,8 @@ def prepare(magic): size = batch.append( random.randint(*TIMESTAMP_RANGE), random_bytes(KEY_SIZE), - random_bytes(VALUE_SIZE)) + random_bytes(VALUE_SIZE), + headers=[]) assert size batch.close() samples.append(bytes(batch.buffer())) @@ -78,3 +79,4 @@ def func(loops, magic): runner = perf.Runner() runner.bench_time_func('batch_read_v0', func, 0) runner.bench_time_func('batch_read_v1', func, 1) +runner.bench_time_func('batch_read_v2', func, 2) |