summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-21 22:32:20 +0200
committerMarek Olšák <[email protected]>2017-06-26 02:17:03 +0200
commit4f38b48e05f544dd081e9374b4611496febbdd67 (patch)
treea513c4e9661abd30a3fd7e4f1ef0239d88f5eaf5 /src
parent09f6915bf89759945fdb05d96473affe5f9ed9fe (diff)
mesa/glthread: decrease the batch size for better perf scaling
This is the key to better performance. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/glthread.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h
index 36692fe5704..dd65931478e 100644
--- a/src/mesa/main/glthread.h
+++ b/src/mesa/main/glthread.h
@@ -26,8 +26,16 @@
#include "main/mtypes.h"
-/* Command size is a number of bytes stored in a short. */
-#define MARSHAL_MAX_CMD_SIZE 65535
+/* The size of one batch and the maximum size of one call.
+ *
+ * This should be as low as possible, so that:
+ * - multiple synchronizations within a frame don't slow us down much
+ * - a smaller number of calls per frame can still get decent parallelism
+ * - the memory footprint of the queue is low, and with that comes a lower
+ * chance of experiencing CPU cache thrashing
+ * but it should be high enough so that u_queue overhead remains negligible.
+ */
+#define MARSHAL_MAX_CMD_SIZE (8 * 1024)
/* The number of batch slots in memory.
*
@@ -35,7 +43,7 @@
* waiting batches. There must be at least 1 slot for a waiting batch,
* so the minimum number of batches is 3.
*/
-#define MARSHAL_MAX_BATCHES 4
+#define MARSHAL_MAX_BATCHES 8
#include <inttypes.h>
#include <stdbool.h>