aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-09 14:38:20 +0100
committereunhhu <[email protected]>2026-10-09 14:38:20 +0100
commit3e3812c74a4e60eece884553db03a90de13b5b0c (patch)
tree02274b5769fdf3dea96b9a0ca6a23aa3fe84de17
parentaa4edf2e592e96daa4475fbf6756b8630bb7e7c5 (diff)
downloadpure-3e3812c74a4e60eece884553db03a90de13b5b0c.tar.gz
pure-3e3812c74a4e60eece884553db03a90de13b5b0c.zip
Makefile: the lists' and the batch executor's loops each start at a 64-byte line (-falign-loops=64 in LIST_OPTIMIZE): a change anywhere in module-batch.c moved knapsack's hot loops and it ran 8.26, 8.74 and 8.20 ms with the same instructions; aligned, every batched work's cycles fell (knapsack 6%, matmul 1.8%, BFS 1.1%) and the executor alone stayed within its noise, at 0.7-2.3% more instructions (the padding)
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c01744b..bf1c1f0 100644
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,10 @@ $(BUILD)/obj/%.o: %.c $(HEADERS)
# The lists' searches count a node's keys and positions whole, and move
# items in a leaf column by column: -O3 makes vector instructions of them
# (docs/design/020: 8% of a breadth first search).
-LIST_OPTIMIZE ?= -O3
+# Their loops start each at a 64-byte line: else a change anywhere in the
+# file moves them, and the batch executor's hot loops ran 6% apart with the
+# same instructions (knapsack 8.26, 8.74, 8.20 ms; docs/research/138).
+LIST_OPTIMIZE ?= -O3 -falign-loops=64
$(BUILD)/obj/core/module-list.o: CFLAGS += $(LIST_OPTIMIZE)
# A batch's instructions are loops over its lanes: vector instructions too (docs/design/024).
$(BUILD)/obj/core/module-batch.o: CFLAGS += $(LIST_OPTIMIZE)