summaryrefslogtreecommitdiffstats
path: root/test/glib/test-profile.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2005-01-15 07:15:38 +0000
committerHavoc Pennington <hp@redhat.com>2005-01-15 07:15:38 +0000
commit9c3d566e95c9080f6040c64531b0ccae22bd5d74 (patch)
treed21a18baa5a5ee9855c8a00eb2c1985bc23ca65f /test/glib/test-profile.c
parent6ec04e917c8b4d477e818aa65ebb5e1fd50e4395 (diff)
2005-01-15 Havoc Pennington <hp@redhat.com>
* Land the new message args API and type system. This patch is huge, but the public API change is not really large. The set of D-BUS types has changed somewhat, and the arg "getters" are more geared toward language bindings; they don't make a copy, etc. There are also some known issues. See these emails for details on this huge patch: http://lists.freedesktop.org/archives/dbus/2004-December/001836.html http://lists.freedesktop.org/archives/dbus/2005-January/001922.html * dbus/dbus-marshal-*: all the new stuff * dbus/dbus-message.c: basically rewritten * dbus/dbus-memory.c (check_guards): with "guards" enabled, init freed blocks to be all non-nul bytes so using freed memory is less likely to work right * dbus/dbus-internals.c (_dbus_test_oom_handling): add DBUS_FAIL_MALLOC=N environment variable, so you can do DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or DBUS_FAIL_MALLOC=10 to make it really, really, really slow and thorough. * qt/message.cpp: port to the new message args API (operator<<): use str.utf8() rather than str.unicode() (pretty sure this is right from the Qt docs?) * glib/dbus-gvalue.c: port to the new message args API * bus/dispatch.c, bus/driver.c: port to the new message args API * dbus/dbus-string.c (_dbus_string_init_const_len): initialize the "locked" flag to TRUE and align_offset to 0; I guess we never looked at these anyhow, but seems cleaner. * dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING): move allocation padding macro to this header; use it to implement (_DBUS_STRING_STATIC): ability to declare a static string. * dbus/dbus-message.c (_dbus_message_has_type_interface_member): change to return TRUE if the interface is not set. * dbus/dbus-string.[hc]: move the D-BUS specific validation stuff to dbus-marshal-validate.[hc] * dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from dbus-internals.c * dbus/Makefile.am: cut over from dbus-marshal.[hc] to dbus-marshal-*.[hc] * dbus/dbus-object-tree.c (_dbus_decompose_path): move this function here from dbus-marshal.c
Diffstat (limited to 'test/glib/test-profile.c')
-rw-r--r--test/glib/test-profile.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/test/glib/test-profile.c b/test/glib/test-profile.c
index 8e636d0a..55dc603f 100644
--- a/test/glib/test-profile.c
+++ b/test/glib/test-profile.c
@@ -48,7 +48,7 @@
*/
#define N_CLIENT_THREADS 1
/* It seems like at least 750000 or so iterations reduces the variability to sane levels */
-#define N_ITERATIONS 750000
+#define N_ITERATIONS 7500
#define N_PROGRESS_UPDATES 20
/* Don't make PAYLOAD_SIZE too huge because it gets used as a static buffer size */
#define PAYLOAD_SIZE 0
@@ -103,17 +103,19 @@ static void
send_echo_method_call (DBusConnection *connection)
{
DBusMessage *message;
+ const char *hello = "Hello World!";
+ dbus_int32_t i32 = 123456;
message = dbus_message_new_method_call (ECHO_SERVICE,
ECHO_PATH,
ECHO_INTERFACE,
ECHO_PING_METHOD);
dbus_message_append_args (message,
- DBUS_TYPE_STRING, "Hello World!",
- DBUS_TYPE_INT32, 123456,
+ DBUS_TYPE_STRING, &hello,
+ DBUS_TYPE_INT32, &i32,
#if PAYLOAD_SIZE > 0
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
- payload, PAYLOAD_SIZE,
+ &payload, PAYLOAD_SIZE,
#endif
DBUS_TYPE_INVALID);
@@ -277,10 +279,6 @@ no_bus_init_server (ServerData *sd)
{
DBusServer *server;
DBusError error;
-
-#ifndef DBUS_DISABLE_ASSERT
- g_printerr ("You should probably --disable-asserts before you profile as they have noticeable overhead\n");
-#endif
dbus_error_init (&error);
server = dbus_server_listen ("unix:tmpdir="DBUS_TEST_SOCKET_DIR,
@@ -511,14 +509,6 @@ with_bus_init_server (ServerData *sd)
g_printerr ("You have to run with_bus mode with the run-test.sh script\n");
exit (1);
}
-
-#ifndef DBUS_DISABLE_ASSERT
- g_printerr ("You should probably --disable-asserts before you profile as they have noticeable overhead\n");
-#endif
-
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- g_printerr ("You should probably --disable-verbose-mode before you profile as verbose has noticeable overhead\n");
-#endif
/* Note that we use the standard global bus connection for the
* server, and the clients open their own connections so they can
@@ -1111,6 +1101,14 @@ main (int argc, char *argv[])
g_thread_init (NULL);
dbus_g_thread_init ();
+#ifndef DBUS_DISABLE_ASSERT
+ g_printerr ("You should probably --disable-asserts before you profile as they have noticeable overhead\n");
+#endif
+
+#if DBUS_ENABLE_VERBOSE_MODE
+ g_printerr ("You should probably --disable-verbose-mode before you profile as verbose has noticeable overhead\n");
+#endif
+
payload = g_malloc (PAYLOAD_SIZE);
/* The actual size of the DBusMessage on the wire, as of Nov 23 2004,