2004-11-22 Havoc Pennington <hp@redhat.com>
authorHavoc Pennington <hp@redhat.com>
Mon, 22 Nov 2004 19:20:29 +0000 (19:20 +0000)
committerHavoc Pennington <hp@redhat.com>
Mon, 22 Nov 2004 19:20:29 +0000 (19:20 +0000)
* test/glib/test-profile.c (N_CLIENT_THREADS): run multiple
threads for more time, so sysprof can get a grip on it.

* dbus/dbus-string.c (_dbus_string_validate_utf8): remove
pointless variable

ChangeLog
dbus/dbus-string.c
test/glib/test-profile.c

index b70e8c8..de52566 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-11-22  Havoc Pennington  <hp@redhat.com>
+
+       * test/glib/test-profile.c (N_CLIENT_THREADS): run multiple
+       threads for more time, so sysprof can get a grip on it.
+
+       * dbus/dbus-string.c (_dbus_string_validate_utf8): remove
+       pointless variable
+
 2004-11-13  Havoc Pennington  <hp@redhat.com>
 
        * test/glib/test-profile.c: fix this thing up a bit
index 75d2210..1611ff0 100644 (file)
@@ -2444,24 +2444,23 @@ _dbus_string_validate_utf8  (const DBusString *str,
       int i, mask, char_len;
       dbus_unichar_t result;
 
-      const unsigned char c = (unsigned char) *p;
-
-      if (c == 0) /* nul bytes not OK */
+      /* nul bytes considered invalid */
+      if (*p == '\0')
         break;
       
       /* Special-case ASCII; this makes us go a lot faster in
        * D-BUS profiles where we are typically validating
        * function names and such. We have to know that
        * all following checks will pass for ASCII though,
-       * comments follow ... 
-       */
-      if (c < 128)
+       * comments follow ...
+       */      
+      if (*p < 128)
         {
           ++p;
           continue;
         }
       
-      UTF8_COMPUTE (c, mask, char_len);
+      UTF8_COMPUTE (*p, mask, char_len);
 
       if (_DBUS_UNLIKELY (char_len == 0))  /* ASCII: char_len == 1 */
         break;
index 762e2fd..a9c502d 100644 (file)
@@ -26,8 +26,8 @@
 #include <dbus/dbus-glib-lowlevel.h>
 #include <stdlib.h>
 
-#define N_CLIENT_THREADS 1
-#define N_ITERATIONS 4000
+#define N_CLIENT_THREADS 4
+#define N_ITERATIONS 40000
 #define PAYLOAD_SIZE 30
 #define ECHO_PATH "/org/freedesktop/EchoTest"
 #define ECHO_INTERFACE "org.freedesktop.EchoTest"
@@ -260,7 +260,7 @@ main (int argc, char *argv[])
   secs = g_timer_elapsed (timer, NULL);
   g_timer_destroy (timer);
 
-  g_printerr ("%g seconds, %d round trips, %g seconds per pingpong\n",
+  g_printerr ("%g seconds, %d round trips, %f seconds per pingpong\n",
               secs, sd.handled, secs/sd.handled);
 #ifndef DBUS_DISABLE_ASSERT
   g_printerr ("You should probably --disable-asserts before you profile as they have noticeable overhead\n");