mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 09:50:01 +00:00
Fix benchmark
This commit is contained in:
parent
5cfa49bb2c
commit
6948dd5120
1 changed files with 5 additions and 3 deletions
|
|
@ -15,10 +15,12 @@ def profile(name, func):
|
|||
|
||||
def simple(name, data):
|
||||
if has_ext:
|
||||
profile("packing %s (ext)" % name, lambda: _packer.packb(data))
|
||||
profile('packing %s (fallback)' % name, lambda: fallback.packb(data))
|
||||
packer = _packer.Packer()
|
||||
profile("packing %s (ext)" % name, lambda: packer.pack(data))
|
||||
packer = fallback.Packer()
|
||||
profile('packing %s (fallback)' % name, lambda: packer.pack(data))
|
||||
|
||||
data = fallback.packb(data)
|
||||
data = packer.pack(data)
|
||||
if has_ext:
|
||||
profile('unpacking %s (ext)' % name, lambda: _unpacker.unpackb(data))
|
||||
profile('unpacking %s (fallback)' % name, lambda: fallback.unpackb(data))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue