Modified performance patches from Arjan van de Ven <arjan@infradead.org>

Subject: [PATCH] fix some performance gaps in Xace

The XaceHook function is used in several hotpaths.
The problem with it (performance wise) is twofold:
 * The XaceHook function has a big switch() statement for the hook number in it
 * The XaceHook function uses varargs to reassemble the final dispatch arguments again

Both are expensive operations... for something that is known at compile time

This patch turns the hotpath XaceHook call into a direct call to avoid
the switch and varargs; this gives me over 10% performance gain
on the x11perf benchmark.
This commit is contained in:
Eamon Walsh
2007-11-06 16:26:09 -05:00
committed by Eamon Walsh
parent aaa50b6411
commit d7c5e8bfc1
3 changed files with 32 additions and 28 deletions

View File

@@ -498,9 +498,9 @@ Dispatch(void)
if (result > (maxBigRequestSize << 2))
result = BadLength;
else {
XaceHook(XACE_AUDIT_BEGIN, client);
XaceHookAuditBegin(client);
result = (* client->requestVector[MAJOROP])(client);
XaceHook(XACE_AUDIT_END, client, result);
XaceHookAuditEnd(client, result);
}
#ifdef XSERVER_DTRACE
XSERVER_REQUEST_DONE(GetRequestName(MAJOROP), MAJOROP,