summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2011-12-13 21:23:12 -0500
committerJeremy Huddleston <jeremyhu@apple.com>2012-01-18 10:40:03 -0800
commit5b28bcb340e279e7f4e76617e86b439092367690 (patch)
tree61adcdaae5bf698af04ee6717244002b5f50bbb1
parente1ea93fec93b13d18df4451210aaaf322b769b6a (diff)
dix: Tune dixLookupDrawable for success
The vast vast vast majority of resource lookups are successful. Move some work to the error paths so we don't punish success. Before: 40000000 trep @ 0.0009 msec (1109091.3/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square After: 40000000 trep @ 0.0009 msec (1148346.9/sec): PutImage 10x10 square 60000000 trep @ 0.0005 msec (2091666.1/sec): ShmPutImage 10x10 square Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 8f9bdfd293ad8e45755efe8d764b4dcc2a724f51)
-rw-r--r--dix/dixutils.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dix/dixutils.c b/dix/dixutils.c
index 1e3134663..cfb03974d 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -202,13 +202,12 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
int rc;
*pDraw = NULL;
- client->errorValue = id;
-
- if (id == INVALID)
- return BadDrawable;
rc = dixLookupResourceByClass((pointer *)&pTmp, id, RC_DRAWABLE, client, access);
+ if (rc != Success)
+ client->errorValue = id;
+
if (rc == BadValue)
return BadDrawable;
if (rc != Success)