Skip to content

Commit

Permalink
coq_makefile produces profile info when PROFILING set, bench sets it
Browse files Browse the repository at this point in the history
profiles seem to compress well, for instance from profiling Hurkens:

- .vo: 48KB (for reference)
- .prof.json: 2.6MB
- .prof.json.gz: 144KB (compression level 6 (default))
- .prof.json.gz: 124KB (compression level 9 (best))
- .prof.json.xz: 108KB (compression level 6 (default); also 9)
- .prof.json.7z: 116KB
- .prof.json.zip: 124KB (compression level 9)

The chrome displayer supports importing straight from gzip so we use that.
  • Loading branch information
SkySkimmer committed Jun 7, 2023
1 parent cd8bac7 commit 1bfff5e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions dev/bench/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ skipped_packages=

# Generate per line timing info in devs that use coq_makefile
export TIMING=1
export PROFILING=1

for coq_opam_package in $sorted_coq_opam_packages; do

Expand Down
2 changes: 2 additions & 0 deletions dev/bench/gitlab-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ bench:
- _bench/files.listing
- _bench/opam.NEW/**/*.log
- _bench/opam.NEW/**/*.timing
- _bench/opam.NEW/**/*.prof.json.gz
- _bench/opam.OLD/**/*.log
- _bench/opam.OLD/**/*.timing
- _bench/opam.OLD/**/*.prof.json.gz
when: always
expire_in: 1 year
environment: bench
Expand Down
13 changes: 11 additions & 2 deletions tools/CoqMakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ else
TIMING_ARG=
endif

ifneq (,$(PROFILING))
PROFILE_ARG=-profile $<.prof.json
PROFILE_ZIP=gzip $<.prof.json
else
PROFILE_ARG=
PROFILE_ZIP=true
endif

# Files #######################################################################
#
# We here define a bunch of variables about the files being part of the
Expand Down Expand Up @@ -796,7 +804,7 @@ define globvorule=
# take care to $$ variables using $< etc
$(1).vo $(1).glob &: $(1).v | $(VDFILE)
$(SHOW)COQC $(1).v
$(HIDE)$$(TIMER) $(COQC) $(COQDEBUG) $$(TIMING_ARG) $(COQFLAGS) $(COQLIBS) $(1).v
$(HIDE)$$(TIMER) $(COQC) $(COQDEBUG) $$(TIMING_ARG) $$(PROFILE_ARG) $(COQFLAGS) $(COQLIBS) $(1).v
ifeq ($(COQDONATIVE), "yes")
$(SHOW)COQNATIVE $(1).vo
$(HIDE)$(call TIMER,$(1).vo.native) $(COQNATIVE) $(COQLIBS) $(1).vo
Expand All @@ -807,7 +815,8 @@ else

$(VOFILES): %.vo: %.v | $(VDFILE)
$(SHOW)COQC $<
$(HIDE)$(TIMER) $(COQC) $(COQDEBUG) $(TIMING_ARG) $(COQFLAGS) $(COQLIBS) $<
$(HIDE)$(TIMER) $(COQC) $(COQDEBUG) $(TIMING_ARG) $(PROFILE_ARG) $(COQFLAGS) $(COQLIBS) $<
$(HIDE)$(PROFILE_ZIP)
ifeq ($(COQDONATIVE), "yes")
$(SHOW)COQNATIVE $@
$(HIDE)$(call TIMER,$@.native) $(COQNATIVE) $(COQLIBS) $@
Expand Down

0 comments on commit 1bfff5e

Please sign in to comment.