chore: speedcenter: benchmark actual, parallel stdlib build

This commit is contained in:
Sebastian Ullrich 2020-08-21 16:03:37 +02:00
parent 060f7f0f04
commit 015903f055
6 changed files with 40 additions and 8 deletions

View file

@ -68,13 +68,21 @@ ifdef CMAKE_LIKE_OUTPUT
@echo "[ ] Building $<"
endif
@mkdir -p "$(@D)"
ifdef PROFILE
\time -f "%U %S" leanc -c -o $@ $< $(LEANC_OPTS) 2>&1 > /dev/null | awk '{ printf "C compilation %fs\n", $$1 + $$2 }' > /dev/stderr
else
leanc -c -o $@ $< $(LEANC_OPTS)
endif
$(BIN_OUT)/$(BIN_NAME): $(addprefix $(TEMP_OUT)/,$(SRCS:.lean=.o)) | $(BIN_OUT)
ifdef CMAKE_LIKE_OUTPUT
@echo "[ ] Linking $@"
endif
ifdef PROFILE
\time -f "%U %S" leanc -o "$@" -x none $^ $(LINK_OPTS) 2>&1 > /dev/null | awk '{ printf "C linking %fs\n", $$1 + $$2 }' > /dev/stderr
else
leanc -o "$@" -x none $^ $(LINK_OPTS)
endif
$(LIB_OUT)/$(STATIC_LIB_NAME): $(addprefix $(TEMP_OUT)/,$(SRCS:.lean=.o)) | $(LIB_OUT)
@rm -f $@

View file

@ -1,7 +1,7 @@
SHELL := /usr/bin/env bash -euo pipefail
# MORE_DEPS: rebuild the stdlib whenever the compiler has changed
LEANMAKE_OPTS=\
LEANMAKE_OPTS+=\
OUT="${LIB}"\
LIB_OUT="${LIB}/lean"\
OLEAN_OUT="${LIB}/lean"\

8
stage0/src/lean.mk.in generated
View file

@ -68,13 +68,21 @@ ifdef CMAKE_LIKE_OUTPUT
@echo "[ ] Building $<"
endif
@mkdir -p "$(@D)"
ifdef PROFILE
\time -f "%U %S" leanc -c -o $@ $< $(LEANC_OPTS) 2>&1 > /dev/null | awk '{ printf "C compilation %fs\n", $$1 + $$2 }' > /dev/stderr
else
leanc -c -o $@ $< $(LEANC_OPTS)
endif
$(BIN_OUT)/$(BIN_NAME): $(addprefix $(TEMP_OUT)/,$(SRCS:.lean=.o)) | $(BIN_OUT)
ifdef CMAKE_LIKE_OUTPUT
@echo "[ ] Linking $@"
endif
ifdef PROFILE
\time -f "%U %S" leanc -o "$@" -x none $^ $(LINK_OPTS) 2>&1 > /dev/null | awk '{ printf "C linking %fs\n", $$1 + $$2 }' > /dev/stderr
else
leanc -o "$@" -x none $^ $(LINK_OPTS)
endif
$(LIB_OUT)/$(STATIC_LIB_NAME): $(addprefix $(TEMP_OUT)/,$(SRCS:.lean=.o)) | $(LIB_OUT)
@rm -f $@

View file

@ -1,7 +1,7 @@
SHELL := /usr/bin/env bash -euo pipefail
# MORE_DEPS: rebuild the stdlib whenever the compiler has changed
LEANMAKE_OPTS=\
LEANMAKE_OPTS+=\
OUT="${LIB}"\
LIB_OUT="${LIB}/lean"\
OLEAN_OUT="${LIB}/lean"\

View file

@ -10,11 +10,19 @@
rusage_properties: ['maxrss']
run_config:
<<: *time
cwd: ../../src
cwd: ../../build/release/stage0
cmd: |
bash -c "find . -name '*.lean' -exec lean --stats -Dprofiler=true -Dprofiler.threshold=9999 {} \; 2>&1 | ../tests/bench/accumulate_profile.py"
max_runs: 3
find lib/lean ! -name libleancpp.a -delete
# for C profiling
#PROFILE=1 CCACHE_DISABLE=1
LEANMAKE_OPTS=LEAN_OPTS="--stats\ -Dprofiler=true\ -Dprofiler.threshold=9999" make -O -j5 make_stdlib 2>&1 > /dev/null | ../../../tests/bench/accumulate_profile.py
max_runs: 2
parse_output: true
# Warmup. Somehow ccache doesn't reuse the cache from the original build? Weird.
build_config:
cmd: |
find lib/lean/ ! -name libleancpp.a -type f -delete
make -j5 make_stdlib
- attributes:
description: stdlib size
tags: [deterministic, fast]

View file

@ -9,11 +9,19 @@
# properties: ['cache-misses', 'wall-clock']
run_config:
<<: *time
cwd: ../../src
cwd: ../../build/release/stage0
cmd: |
bash -c "find . -name '*.lean' -exec lean --stats -Dprofiler=true -Dprofiler.threshold=9999 {} \; 2>&1 | ../tests/bench/accumulate_profile.py"
max_runs: 3
find lib/lean ! -name libleancpp.a -delete
# for C profiling
#PROFILE=1 CCACHE_DISABLE=1
LEANMAKE_OPTS=LEAN_OPTS="--stats\ -Dprofiler=true\ -Dprofiler.threshold=9999" make -O -j5 make_stdlib 2>&1 > /dev/null | ../../../tests/bench/accumulate_profile.py
max_runs: 2
parse_output: true
# Warmup. Somehow ccache doesn't reuse the cache from the original build? Weird.
build_config:
cmd: |
find lib/lean/ ! -name libleancpp.a -type f -delete
make -j5 make_stdlib
- attributes:
description: stdlib size
tags: [deterministic, fast]