svn commit: samba r7296 - in
branches/SAMBA_4_0/source/lib/messaging: .
tridge at samba.org
tridge at samba.org
Sun Jun 5 07:37:27 GMT 2005
Author: tridge
Date: 2005-06-05 07:37:27 +0000 (Sun, 05 Jun 2005)
New Revision: 7296
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7296
Log:
avoid two stat() calls per message. This increases the raw message
rate from 20k/sec to 55k/sec. The irpc rate goes from 16k/sec to
34k/sec.
I should have run strace -T on this a long time ago.
Modified:
branches/SAMBA_4_0/source/lib/messaging/messaging.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/messaging/messaging.c
===================================================================
--- branches/SAMBA_4_0/source/lib/messaging/messaging.c 2005-06-05 07:30:44 UTC (rev 7295)
+++ branches/SAMBA_4_0/source/lib/messaging/messaging.c 2005-06-05 07:37:27 UTC (rev 7296)
@@ -36,6 +36,7 @@
struct messaging_context {
uint32_t server_id;
struct socket_context *sock;
+ const char *base_path;
const char *path;
struct dispatch_fn *dispatch;
struct messaging_rec *pending;
@@ -94,13 +95,9 @@
/*
return the path to a messaging socket
*/
-static char *messaging_path(TALLOC_CTX *mem_ctx, uint32_t server_id)
+static char *messaging_path(struct messaging_context *msg, uint32_t server_id)
{
- char *name = talloc_asprintf(mem_ctx, "messaging/msg.%u", (unsigned)server_id);
- char *ret;
- ret = smbd_tmp_path(mem_ctx, name);
- talloc_free(name);
- return ret;
+ return talloc_asprintf(msg, "%s/msg.%u", msg->base_path, (unsigned)server_id);
}
/*
@@ -308,7 +305,8 @@
data->data, dlength);
}
- rec->path = messaging_path(rec, server);
+ rec->path = messaging_path(msg, server);
+ talloc_steal(rec, rec->path);
status = try_send(rec);
if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
@@ -369,7 +367,8 @@
mkdir(path, 0700);
talloc_free(path);
- msg->path = messaging_path(msg, server_id);
+ msg->base_path = smbd_tmp_path(msg, "messaging");
+ msg->path = messaging_path(msg, server_id);
msg->server_id = server_id;
msg->dispatch = NULL;
msg->pending = NULL;
More information about the samba-cvs
mailing list