[PATCH 11/22] dbus: Use shared NoopDDA to utilize code cache better

Pauli ext-pauli.nieminen at nokia.com
Wed Dec 29 11:27:23 PST 2010


From: Pauli Nieminen <ext-pauli.nieminen at nokia.com>

Calling function that is in code cache is order of magnitude faster. In
arm non-cached simple function takes about 1us while cached function
takes max 200ns.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 config/dbus-core.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/config/dbus-core.c b/config/dbus-core.c
index 4c5e10f..d4961b3 100644
--- a/config/dbus-core.c
+++ b/config/dbus-core.c
@@ -61,11 +61,6 @@ wakeup_handler(pointer data, int err, pointer read_mask)
     }
 }
 
-static void
-block_handler(pointer data, struct timeval **tv, pointer read_mask)
-{
-}
-
 /**
  * Disconnect (if we haven't already been forcefully disconnected), clean up
  * after ourselves, and call all registered disconnect hooks.
@@ -86,7 +81,7 @@ teardown(void)
     if (bus_info.connection)
         dbus_connection_unref(bus_info.connection);
 
-    RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info);
+    RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, wakeup_handler, &bus_info);
     if (bus_info.fd != -1)
         RemoveGeneralSocket(bus_info.fd);
     bus_info.fd = -1;
@@ -164,7 +159,7 @@ connect_to_bus(void)
     dbus_error_free(&error);
     AddGeneralSocket(bus_info.fd);
 
-    RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info);
+    RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, wakeup_handler, &bus_info);
 
     for (hook = bus_info.hooks; hook; hook = hook->next) {
         if (hook->connect)
-- 
1.7.0.4



More information about the xorg-devel mailing list