From e386e228c54914b0a1f8babe3659ea5629a3cb7d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 9 Sep 2022 13:53:31 -0500 Subject: [PATCH] chore: add marshall benchmark (#14) --- bench/marshall.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bench/marshall.py diff --git a/bench/marshall.py b/bench/marshall.py new file mode 100644 index 0000000..f376d84 --- /dev/null +++ b/bench/marshall.py @@ -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")