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_compose.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_compose.py')
-rw-r--r-- | benchmarks/record_batch_compose.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/benchmarks/record_batch_compose.py b/benchmarks/record_batch_compose.py index 86012df..aca669d 100644 --- a/benchmarks/record_batch_compose.py +++ b/benchmarks/record_batch_compose.py @@ -58,7 +58,8 @@ def func(loops, magic): magic, batch_size=DEFAULT_BATCH_SIZE, compression_type=0) for _ in range(MESSAGES_PER_BATCH): key, value, timestamp = next(precomputed_samples) - size = batch.append(timestamp=timestamp, key=key, value=value) + size = batch.append( + timestamp=timestamp, key=key, value=value) assert size batch.close() results.append(batch.buffer()) @@ -73,3 +74,4 @@ def func(loops, magic): runner = perf.Runner() runner.bench_time_func('batch_append_v0', func, 0) runner.bench_time_func('batch_append_v1', func, 1) +runner.bench_time_func('batch_append_v2', func, 2) |