chore: add marshall benchmark (#14)

This commit is contained in:
J. Nick Koston 2022-09-09 13:53:31 -05:00 committed by GitHub
parent 471def6f19
commit e386e228c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

19
bench/marshall.py Normal file
View File

@ -0,0 +1,19 @@
import timeit
from dbus_fast import Message
message = Message(
destination="org.bluez",
path="/",
interface="org.freedesktop.DBus.ObjectManager",
member="GetManagedObjects",
)
def marhsall_bluez_get_managed_objects_message():
message._marshall()
count = 1000000
time = timeit.Timer(marhsall_bluez_get_managed_objects_message).timeit(count)
print(f"Marshalling {count} bluez get managed objects messages took {time} seconds")