[cairo] [PATCH] boilerplate/gl: Disable thread awareness

Martin Robinson mrobinson at igalia.com
Thu Apr 4 08:10:55 PDT 2013


>From d35e5e2bc75ddf2046c91dc0b3f40d406bab8850 Mon Sep 17 00:00:00 2001
From: Martin Robinson <mrobinson at igalia.com>
Date: Fri, 29 Mar 2013 11:09:48 -0700
Subject: [PATCH] boilerplate/gl: Disable thread awareness

This dramatically speeds up testing on NVidia and actually makes it
possible to run traces within a reasonable amount of time.

cairo-perf-trace results for:
NVIDIA Corporation GeForce GTS 250/PCIe/SSE2 3.3.0 NVIDIA 310.14

Before:
test              min(s)  median(s) stddev. count
gvim              30.924  31.251    0.72%   5/6
firefox-fishbowl  168.751 201.017   12.46%  8/8
(exited early)

After:
test              min(s)  median(s) stddev. count
gvim              1.294   1.325     1.79%   6/6
firefox-fishbowl  18.540  19.104    1.54%   6/6
---
 boilerplate/cairo-boilerplate-egl.c |    2 ++
 boilerplate/cairo-boilerplate-glx.c |    3 +++
 2 files changed, 5 insertions(+)

diff --git a/boilerplate/cairo-boilerplate-egl.c b/boilerplate/cairo-boilerplate-egl.c
index e1a46e4..99bee64 100644
--- a/boilerplate/cairo-boilerplate-egl.c
+++ b/boilerplate/cairo-boilerplate-egl.c
@@ -130,6 +130,8 @@ _cairo_boilerplate_egl_create_surface (const char		 *name,
     }
 
     gltc->device = cairo_egl_device_create (gltc->dpy, gltc->ctx);
+    if (mode == CAIRO_BOILERPLATE_MODE_PERF)
+	cairo_gl_device_set_thread_aware(gltc->device, FALSE);
 
     if (width < 1)
 	width = 1;
diff --git a/boilerplate/cairo-boilerplate-glx.c b/boilerplate/cairo-boilerplate-glx.c
index 52cd99f..0643644 100644
--- a/boilerplate/cairo-boilerplate-glx.c
+++ b/boilerplate/cairo-boilerplate-glx.c
@@ -135,6 +135,9 @@ _cairo_boilerplate_gl_create_surface (const char		*name,
     gltc->ctx = ctx;
     gltc->device = cairo_glx_device_create (dpy, ctx);
 
+    if (mode == CAIRO_BOILERPLATE_MODE_PERF)
+	cairo_gl_device_set_thread_aware(gltc->device, FALSE);
+
     gltc->surface = surface = cairo_gl_surface_create (gltc->device,
 						       content, width, height);
     if (cairo_surface_status (surface))
-- 
1.7.10.4



More information about the cairo mailing list