From d3c829f0e931eab8663a849737c29648d68592f6 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 11 Jan 2024 18:28:27 -0700 Subject: [PATCH 01/35] Add a placeholder workflow to gather new competitive benchmarks --- .github/workflows/competitive-benchmarks.yml | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/competitive-benchmarks.yml diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml new file mode 100644 index 00000000..7fb12053 --- /dev/null +++ b/.github/workflows/competitive-benchmarks.yml @@ -0,0 +1,43 @@ +name: competitive-benchmarks + +on: + push: + branches: + - main # TODO: change to gather-new-benchmark-data + paths: + - 'qi-sdk/profile/**' + - 'qi-lib/**' + - '.github/workflows/competitive-benchmarks.yml' + +defaults: + run: + shell: bash + +jobs: + deploy-docs: + runs-on: ubuntu-latest + name: Build and deploy backup docs + steps: + - name: Checkout + uses: actions/checkout@master + - name: Install Racket + uses: Bogdanp/setup-racket@v1.9.1 + with: + architecture: 'x64' + distribution: 'full' + variant: 'CS' + version: 'stable' + - name: Install Package and its Dependencies + run: make install + - name: Install SDK + run: make install-sdk # TODO: should first add dependency on new benchmarks suite in info.rkt + - name: Run benchmark + shell: 'bash --noprofile --norc -eo pipefail {0}' + run: make new-benchmarks # TODO: add this new target + - name: Push to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + folder: competitive-benchmarks/qi + target-folder: competitive-benchmarks + branch: gh-pages + clean: true From e69aa1e48ace3d7a007b29194b2524da298dc69d Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 18:34:06 -0700 Subject: [PATCH 02/35] Add SDK dependency on the new benchmarking suite (via git URL) --- .github/workflows/competitive-benchmarks.yml | 2 +- qi-sdk/info.rkt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index 7fb12053..2ba669ef 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -30,7 +30,7 @@ jobs: - name: Install Package and its Dependencies run: make install - name: Install SDK - run: make install-sdk # TODO: should first add dependency on new benchmarks suite in info.rkt + run: make install-sdk - name: Run benchmark shell: 'bash --noprofile --norc -eo pipefail {0}' run: make new-benchmarks # TODO: add this new target diff --git a/qi-sdk/info.rkt b/qi-sdk/info.rkt index e561023d..7418eb04 100644 --- a/qi-sdk/info.rkt +++ b/qi-sdk/info.rkt @@ -11,6 +11,7 @@ "relation-lib" "csv-writing" "require-latency" + "git://gitlab.com/racketeer/qi-benchmarks.git#master" "cover" "cover-coveralls")) (define build-deps '()) From 795fe55c56902122e12c8358eef4ec7fb0c335ad Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 18:34:56 -0700 Subject: [PATCH 03/35] Set benchmarks trigger to development branch for testing --- .github/workflows/competitive-benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index 2ba669ef..52260760 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -3,7 +3,7 @@ name: competitive-benchmarks on: push: branches: - - main # TODO: change to gather-new-benchmark-data + - gather-new-benchmark-data paths: - 'qi-sdk/profile/**' - 'qi-lib/**' From 173dc964e320d8129f24eeffb6be4d9ab4374d22 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 18:59:11 -0700 Subject: [PATCH 04/35] Generate new benchmarks report and push it to GH pages --- .github/workflows/competitive-benchmarks.yml | 7 +++++-- Makefile | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index 52260760..fc038da2 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -31,13 +31,16 @@ jobs: run: make install - name: Install SDK run: make install-sdk + - name: Install New Benchmarks Suite + run: | + git clone https://gitlab.com/racketeer/qi-benchmarks.git - name: Run benchmark shell: 'bash --noprofile --norc -eo pipefail {0}' - run: make new-benchmarks # TODO: add this new target + run: make new-benchmarks - name: Push to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.4.1 with: - folder: competitive-benchmarks/qi + folder: qi-benchmarks/results/output target-folder: competitive-benchmarks branch: gh-pages clean: true diff --git a/Makefile b/Makefile index 1230c209..f6da295a 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,7 @@ help: @echo "coverage-check - Run test coverage checker" @echo "coverage-report - View test coverage report" @echo "docs - view docs in a browser" + @echo "new-benchmarks - Run new benchmarks and generate an HTML report" @echo "profile - Get a performance profile of any Racket command" @echo "benchmark - Run comprehensive performance benchmarks" @echo "benchmark-competitive - Run competitive benchmarks" @@ -189,6 +190,10 @@ profile: @echo "For more options:" @echo " raco profile --help" +# assumes the existence of the qi-benchmarks folder +new-benchmarks: + cd qi-benchmarks && ./create-benchmarks.sh && mv results/* results/output + benchmark-local: racket $(PACKAGE-NAME)-sdk/benchmarks/local/report.rkt @@ -212,4 +217,4 @@ performance-report: performance-regression-report: @racket $(PACKAGE-NAME)-sdk/benchmarks/report.rkt -r $(REF) -.PHONY: help install remove build build-docs build-all clean check-deps test test-flow test-on test-threading test-switch test-definitions test-macro test-util test-expander test-compiler test-probe test-with-errortrace errortrace errortrace-flow errortrace-on errortrace-threading errortrace-switch errortrace-definitions errortrace-macro errortrace-util errortrace-probe docs cover coverage-check coverage-report cover-coveralls profile benchmark-local benchmark-loading benchmark-selected-forms benchmark-competitive benchmark-nonlocal benchmark performance-report performance-regression-report +.PHONY: help install remove build build-docs build-all clean check-deps test test-flow test-on test-threading test-switch test-definitions test-macro test-util test-expander test-compiler test-probe test-with-errortrace errortrace errortrace-flow errortrace-on errortrace-threading errortrace-switch errortrace-definitions errortrace-macro errortrace-util errortrace-probe docs cover coverage-check coverage-report cover-coveralls profile new-benchmarks benchmark-local benchmark-loading benchmark-selected-forms benchmark-competitive benchmark-nonlocal benchmark performance-report performance-regression-report From 17fa8bf057635ed48688f454010d692f9f025ac2 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 19:11:52 -0700 Subject: [PATCH 05/35] Rename workflow copypasta --- .github/workflows/competitive-benchmarks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index fc038da2..4a16b927 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -14,9 +14,9 @@ defaults: shell: bash jobs: - deploy-docs: + deploy-benchmarks: runs-on: ubuntu-latest - name: Build and deploy backup docs + name: Generate and deploy competitive benchmarks steps: - name: Checkout uses: actions/checkout@master From af630bf99aeeb3ed957eda52815468ab45d6ffc4 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 19:12:06 -0700 Subject: [PATCH 06/35] Remove unused git dependency on qi-benchmarks --- qi-sdk/info.rkt | 1 - 1 file changed, 1 deletion(-) diff --git a/qi-sdk/info.rkt b/qi-sdk/info.rkt index 7418eb04..e561023d 100644 --- a/qi-sdk/info.rkt +++ b/qi-sdk/info.rkt @@ -11,7 +11,6 @@ "relation-lib" "csv-writing" "require-latency" - "git://gitlab.com/racketeer/qi-benchmarks.git#master" "cover" "cover-coveralls")) (define build-deps '()) From 9dc3dd0aac4f95d1a985b457065af769dd8f04c3 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 19:20:15 -0700 Subject: [PATCH 07/35] Make benchmarks script executable before invoking it --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f6da295a..ba2c0cd8 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ profile: # assumes the existence of the qi-benchmarks folder new-benchmarks: - cd qi-benchmarks && ./create-benchmarks.sh && mv results/* results/output + cd qi-benchmarks && chmod +x create-benchmarks.sh && ./create-benchmarks.sh && mv results/* results/output benchmark-local: racket $(PACKAGE-NAME)-sdk/benchmarks/local/report.rkt From 92ff62097b2b3ed8a0dbe8ca16e8dff46f21d340 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 19:24:31 -0700 Subject: [PATCH 08/35] Add a dummy file to trigger the benchmarks workflow --- qi-sdk/profile/dummy.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 qi-sdk/profile/dummy.txt diff --git a/qi-sdk/profile/dummy.txt b/qi-sdk/profile/dummy.txt new file mode 100644 index 00000000..63e60829 --- /dev/null +++ b/qi-sdk/profile/dummy.txt @@ -0,0 +1 @@ +Test file to trigger workflows. From 1bb4223ca9ad512fc5723475a51b55cf68623477 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 19:54:15 -0700 Subject: [PATCH 09/35] Add `simple-polynomial` dependency --- qi-sdk/info.rkt | 1 + 1 file changed, 1 insertion(+) diff --git a/qi-sdk/info.rkt b/qi-sdk/info.rkt index e561023d..7f5351d5 100644 --- a/qi-sdk/info.rkt +++ b/qi-sdk/info.rkt @@ -11,6 +11,7 @@ "relation-lib" "csv-writing" "require-latency" + "simple-polynomial" ; for qi-benchmarks "cover" "cover-coveralls")) (define build-deps '()) From 2dd0f38ef72d8310a18364bdbfbbc5b5815238d8 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 19:58:45 -0700 Subject: [PATCH 10/35] poke workflow --- qi-sdk/profile/dummy.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qi-sdk/profile/dummy.txt b/qi-sdk/profile/dummy.txt index 63e60829..c2cf31d3 100644 --- a/qi-sdk/profile/dummy.txt +++ b/qi-sdk/profile/dummy.txt @@ -1 +1,3 @@ Test file to trigger workflows. + +Poke! From 879d109f0fd337fc634a44d261ece495d95d4faf Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 20:09:38 -0700 Subject: [PATCH 11/35] Add `colorblind-palette` dependency --- qi-sdk/info.rkt | 1 + 1 file changed, 1 insertion(+) diff --git a/qi-sdk/info.rkt b/qi-sdk/info.rkt index 7f5351d5..a75bf699 100644 --- a/qi-sdk/info.rkt +++ b/qi-sdk/info.rkt @@ -12,6 +12,7 @@ "csv-writing" "require-latency" "simple-polynomial" ; for qi-benchmarks + "colorblind-palette" "cover" "cover-coveralls")) (define build-deps '()) From bd5065b9af9f76593469cf8fece6ee255e9522ed Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Thu, 18 Jan 2024 20:10:04 -0700 Subject: [PATCH 12/35] poke.. --- qi-sdk/profile/dummy.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/qi-sdk/profile/dummy.txt b/qi-sdk/profile/dummy.txt index c2cf31d3..df5b2016 100644 --- a/qi-sdk/profile/dummy.txt +++ b/qi-sdk/profile/dummy.txt @@ -1,3 +1,4 @@ Test file to trigger workflows. Poke! +Poke! From be340d965742ed88586bae36dcae3e54c4367742 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 19 Jan 2024 12:05:10 -0700 Subject: [PATCH 13/35] try running the github benchmarks profile --- .github/workflows/competitive-benchmarks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index 4a16b927..6f6757d4 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -34,6 +34,7 @@ jobs: - name: Install New Benchmarks Suite run: | git clone https://gitlab.com/racketeer/qi-benchmarks.git + sed -i -e 's/p-preview/p-github/' qi-benchmarks/report.scrbl - name: Run benchmark shell: 'bash --noprofile --norc -eo pipefail {0}' run: make new-benchmarks From b5ed664a879faef1afaed9e46ac39b9349be85f0 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 19 Jan 2024 12:05:44 -0700 Subject: [PATCH 14/35] poke.. --- qi-sdk/profile/dummy.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/qi-sdk/profile/dummy.txt b/qi-sdk/profile/dummy.txt index df5b2016..9a13fe19 100644 --- a/qi-sdk/profile/dummy.txt +++ b/qi-sdk/profile/dummy.txt @@ -2,3 +2,4 @@ Test file to trigger workflows. Poke! Poke! +Poke! From 9d80438806a78610714264870a8257f0578c7df2 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 12:06:18 -0700 Subject: [PATCH 15/35] Use new command line arg to indicate benchmark profile --- .github/workflows/competitive-benchmarks.yml | 1 - Makefile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index 6f6757d4..4a16b927 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -34,7 +34,6 @@ jobs: - name: Install New Benchmarks Suite run: | git clone https://gitlab.com/racketeer/qi-benchmarks.git - sed -i -e 's/p-preview/p-github/' qi-benchmarks/report.scrbl - name: Run benchmark shell: 'bash --noprofile --norc -eo pipefail {0}' run: make new-benchmarks diff --git a/Makefile b/Makefile index ba2c0cd8..0e9ec0de 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ profile: # assumes the existence of the qi-benchmarks folder new-benchmarks: - cd qi-benchmarks && chmod +x create-benchmarks.sh && ./create-benchmarks.sh && mv results/* results/output + cd qi-benchmarks && chmod +x create-benchmarks.sh && ./create-benchmarks.sh github && mv results/* results/output benchmark-local: racket $(PACKAGE-NAME)-sdk/benchmarks/local/report.rkt From 5312133a8cfe8ea1ccbbbdcc46a612a75e3bfa0f Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 12:07:17 -0700 Subject: [PATCH 16/35] poke.. --- qi-sdk/profile/dummy.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/qi-sdk/profile/dummy.txt b/qi-sdk/profile/dummy.txt index 9a13fe19..c89faaf7 100644 --- a/qi-sdk/profile/dummy.txt +++ b/qi-sdk/profile/dummy.txt @@ -3,3 +3,4 @@ Test file to trigger workflows. Poke! Poke! Poke! +Poke! From 92c5911b3535a7c3a05939e4e70887427c1b9333 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 12:33:27 -0700 Subject: [PATCH 17/35] add SDK dependency on `vlibench` --- qi-sdk/info.rkt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qi-sdk/info.rkt b/qi-sdk/info.rkt index a75bf699..538de19c 100644 --- a/qi-sdk/info.rkt +++ b/qi-sdk/info.rkt @@ -11,8 +11,7 @@ "relation-lib" "csv-writing" "require-latency" - "simple-polynomial" ; for qi-benchmarks - "colorblind-palette" + "vlibench" "cover" "cover-coveralls")) (define build-deps '()) From cc1f0beff3d8abeb510465ba1e9cfa3f80024740 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 12:40:42 -0700 Subject: [PATCH 18/35] no need to install benchmarking suite as it's a dependency --- .github/workflows/competitive-benchmarks.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index 4a16b927..4684be2f 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -31,9 +31,6 @@ jobs: run: make install - name: Install SDK run: make install-sdk - - name: Install New Benchmarks Suite - run: | - git clone https://gitlab.com/racketeer/qi-benchmarks.git - name: Run benchmark shell: 'bash --noprofile --norc -eo pipefail {0}' run: make new-benchmarks From 7cd4c1cdaade6c20b8857ed7e0cb2d534b25c8b9 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 12:42:39 -0700 Subject: [PATCH 19/35] note a todo --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 0e9ec0de..25cd64ef 100644 --- a/Makefile +++ b/Makefile @@ -191,6 +191,7 @@ profile: @echo " raco profile --help" # assumes the existence of the qi-benchmarks folder +# TODO: need to update this for vlibench, and rename qi-benchmarks to vlibench new-benchmarks: cd qi-benchmarks && chmod +x create-benchmarks.sh && ./create-benchmarks.sh github && mv results/* results/output From 00178dc507233a3edcdd71dc34f3fb9dee0be158 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 14:27:24 -0700 Subject: [PATCH 20/35] Add report-qi scribble module from Dominik --- qi-sdk/profile/report-qi.scrbl | 166 +++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 qi-sdk/profile/report-qi.scrbl diff --git a/qi-sdk/profile/report-qi.scrbl b/qi-sdk/profile/report-qi.scrbl new file mode 100644 index 00000000..8778e215 --- /dev/null +++ b/qi-sdk/profile/report-qi.scrbl @@ -0,0 +1,166 @@ +#lang scribble/manual + +@require[scribble-math/dollar + srfi/19 + vlibench + (for-syntax racket/base) + racket/cmdline + racket/string + racket/function] + +@;Command-line handling ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +@(define config-profile (make-parameter 'preview)) +@(command-line + #:once-each + (("-p" "--profile") + name + "profile name to use (use 'list' to list available profiles)" + (when (equal? name "list") + (displayln + (format + "Available profiles: ~a" + (string-join + (for/list (((k v) vlib/profiles)) + (symbol->string k)) + ", "))) + (exit 0)) + (config-profile (string->symbol name)))) + +@title[#:style (with-html5 manual-doc-style)]{Qi Normal/Deforested Competitive Benchmarks} + +@;Qi version helper ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +@(begin-for-syntax + (require setup/getinfo) + (define (get-version) + ((get-info '("qi")) 'version))) +@(define-syntax (get-qi-version stx) + (datum->syntax stx (get-version) stx stx)) + +@;Specification ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +@(module qi-default racket/base + (require qi + racket/math + racket/list + vlibench) + + (provide qi-filter-map-prog + qi-filter-map-foldl-prog + qi-long-pipeline-prog + qi-range-map-car-prog) + + (define impl-label "Qi") + + (define qi-filter-map-prog + (make-vlib/prog impl-label + (flow (~>> (filter odd?) (map sqr))))) + + (define qi-filter-map-foldl-prog + (make-vlib/prog impl-label + (flow (~>> (filter odd?) (map sqr) (foldl + 0))))) + + (define qi-long-pipeline-prog + (make-vlib/prog impl-label + (flow (~>> range + (filter odd?) + (map sqr) + values + (filter (lambda (v) (< (remainder v 10) 5))) + (map (lambda (v) (* v 2))) + (foldl + 0))))) + + (define qi-range-map-car-prog + (make-vlib/prog impl-label + (flow (~>> range (map sqr) car)))) + ) + +@(module qi-deforested racket/base + (require qi + qi/list + racket/math + vlibench) + + (provide qi/d-filter-map-prog + qi/d-filter-map-foldl-prog + qi/d-long-pipeline-prog + qi/d-range-map-car-prog) + + (define impl-label "Qi deforested") + + (define qi/d-filter-map-prog + (make-vlib/prog impl-label + (flow (~>> (filter odd?) (map sqr))))) + + (define qi/d-filter-map-foldl-prog + (make-vlib/prog impl-label + (flow (~>> (filter odd?) (map sqr) (foldl + 0))))) + + (define qi/d-long-pipeline-prog + (make-vlib/prog impl-label + (flow (~>> range + (filter odd?) + (map sqr) + values + (filter (lambda (v) (< (remainder v 10) 5))) + (map (lambda (v) (* v 2))) + (foldl + 0))))) + + (define qi/d-range-map-car-prog + (make-vlib/prog impl-label + (flow (~>> range (map sqr) car)))) + ) + +@(require 'qi-default + 'qi-deforested) + +@(define benchmarks-specs + (list + (vlib/spec 'filter-map + make-random-integer-list + (list qi/d-filter-map-prog + qi-filter-map-prog)) + (vlib/spec 'filter-map-foldl + make-random-integer-list + (list qi/d-filter-map-foldl-prog + qi-filter-map-foldl-prog)) + (vlib/spec 'long-pipeline + identity + (list qi/d-long-pipeline-prog + qi-long-pipeline-prog)) + (vlib/spec 'range-map-car + identity + (list qi/d-range-map-car-prog + qi-range-map-car-prog)))) + +@; Processing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +@define[profile (hash-ref vlib/profiles (config-profile))] +@(define results + (for/list ((spec (in-list benchmarks-specs))) + (run-benchmark + spec + #:profile profile))) + +@; Rendering ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +@section{General Information} + +Date and time: @(date->string (seconds->date (current-seconds))) + +@snippet:vlib/profile[profile] + +@snippet:system-information[#:more-versions `(("Qi Version: " ,(get-qi-version)))] + + +@section{Summary Results} + +@snippet:summary-results-table[results] + + +@section{Detailed Results} + +@snippet:benchmark/s-duration[results] + +Measured lengths: @(racket #,(for/list ((len (vlib/profile->steps profile))) len)) + +@(for/list ((result (in-list results))) + (snippet:benchmark-result result)) From f1ec0b30f60803a296c8ea9b29514aab699f339c Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 15:14:17 -0700 Subject: [PATCH 21/35] update to use vlibench entry point --- .github/workflows/competitive-benchmarks.yml | 2 +- Makefile | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index 4684be2f..e8ed5eab 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -37,7 +37,7 @@ jobs: - name: Push to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.4.1 with: - folder: qi-benchmarks/results/output + folder: qi-sdk/results/output target-folder: competitive-benchmarks branch: gh-pages clean: true diff --git a/Makefile b/Makefile index 25cd64ef..6e2ad742 100644 --- a/Makefile +++ b/Makefile @@ -193,7 +193,15 @@ profile: # assumes the existence of the qi-benchmarks folder # TODO: need to update this for vlibench, and rename qi-benchmarks to vlibench new-benchmarks: - cd qi-benchmarks && chmod +x create-benchmarks.sh && ./create-benchmarks.sh github && mv results/* results/output + cd qi-sdk && \ + scribble \ + ++convert svg \ + ++arg -p \ + ++arg github \ + --html \ + --dest results/output \ + --dest-name index.html \ + report-qi.scrbl benchmark-local: racket $(PACKAGE-NAME)-sdk/benchmarks/local/report.rkt From cb5430454a307df1602762729e4d6abd5f2d1575 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 15:14:58 -0700 Subject: [PATCH 22/35] poke.. --- qi-sdk/profile/dummy.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/qi-sdk/profile/dummy.txt b/qi-sdk/profile/dummy.txt index c89faaf7..c087ce0c 100644 --- a/qi-sdk/profile/dummy.txt +++ b/qi-sdk/profile/dummy.txt @@ -4,3 +4,4 @@ Poke! Poke! Poke! Poke! +Poke! From 888cc3b55a7708762f65fe12ce26c3d203adea3d Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 15:25:17 -0700 Subject: [PATCH 23/35] fix path --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6e2ad742..b0547f33 100644 --- a/Makefile +++ b/Makefile @@ -193,7 +193,7 @@ profile: # assumes the existence of the qi-benchmarks folder # TODO: need to update this for vlibench, and rename qi-benchmarks to vlibench new-benchmarks: - cd qi-sdk && \ + cd qi-sdk/profile && \ scribble \ ++convert svg \ ++arg -p \ From 8360019af1b6666969256f9b48a0c0f2803e37f7 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 1 Mar 2024 15:25:38 -0700 Subject: [PATCH 24/35] poke.. --- qi-sdk/profile/dummy.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/qi-sdk/profile/dummy.txt b/qi-sdk/profile/dummy.txt index c087ce0c..f82fd475 100644 --- a/qi-sdk/profile/dummy.txt +++ b/qi-sdk/profile/dummy.txt @@ -5,3 +5,4 @@ Poke! Poke! Poke! Poke! +Poke! From fbb358b972a203922131e6a4fedde9af4ce5b99f Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 10:58:01 -0700 Subject: [PATCH 25/35] =?UTF-8?q?update=20paths=20profile=20=E2=86=92=20be?= =?UTF-8?q?nchmarks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/competitive-benchmarks.yml | 2 +- Makefile | 2 +- qi-sdk/{profile => benchmarks}/dummy.txt | 0 qi-sdk/{profile => benchmarks}/report-qi.scrbl | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename qi-sdk/{profile => benchmarks}/dummy.txt (100%) rename qi-sdk/{profile => benchmarks}/report-qi.scrbl (100%) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index e8ed5eab..d3a3f5b5 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -5,7 +5,7 @@ on: branches: - gather-new-benchmark-data paths: - - 'qi-sdk/profile/**' + - 'qi-sdk/benchmarks/**' - 'qi-lib/**' - '.github/workflows/competitive-benchmarks.yml' diff --git a/Makefile b/Makefile index b0547f33..94499c97 100644 --- a/Makefile +++ b/Makefile @@ -193,7 +193,7 @@ profile: # assumes the existence of the qi-benchmarks folder # TODO: need to update this for vlibench, and rename qi-benchmarks to vlibench new-benchmarks: - cd qi-sdk/profile && \ + cd qi-sdk/benchmarks && \ scribble \ ++convert svg \ ++arg -p \ diff --git a/qi-sdk/profile/dummy.txt b/qi-sdk/benchmarks/dummy.txt similarity index 100% rename from qi-sdk/profile/dummy.txt rename to qi-sdk/benchmarks/dummy.txt diff --git a/qi-sdk/profile/report-qi.scrbl b/qi-sdk/benchmarks/report-qi.scrbl similarity index 100% rename from qi-sdk/profile/report-qi.scrbl rename to qi-sdk/benchmarks/report-qi.scrbl From 67accb5a4141ca33aa2067f3aaff0523813d38e4 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 10:59:06 -0700 Subject: [PATCH 26/35] fix path to benchmarks output --- .github/workflows/competitive-benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index d3a3f5b5..2ddb1b67 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -37,7 +37,7 @@ jobs: - name: Push to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.4.1 with: - folder: qi-sdk/results/output + folder: qi-sdk/benchmarks/results/output target-folder: competitive-benchmarks branch: gh-pages clean: true From b17d23545e6464cc5ffd39946c571447e0185793 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 12:17:47 -0700 Subject: [PATCH 27/35] Fix CLI (from Dominik) --- qi-sdk/benchmarks/report-qi.scrbl | 37 +++++++++++++++++-------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/qi-sdk/benchmarks/report-qi.scrbl b/qi-sdk/benchmarks/report-qi.scrbl index 8778e215..25dc3237 100644 --- a/qi-sdk/benchmarks/report-qi.scrbl +++ b/qi-sdk/benchmarks/report-qi.scrbl @@ -9,22 +9,25 @@ racket/function] @;Command-line handling ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -@(define config-profile (make-parameter 'preview)) -@(command-line - #:once-each - (("-p" "--profile") - name - "profile name to use (use 'list' to list available profiles)" - (when (equal? name "list") - (displayln - (format - "Available profiles: ~a" - (string-join - (for/list (((k v) vlib/profiles)) - (symbol->string k)) - ", "))) - (exit 0)) - (config-profile (string->symbol name)))) +@(define config-profile + (let () + (define profile-box (box 'preview)) + (command-line + #:once-each + (("-p" "--profile") + name + "profile name to use (use 'list' to list available profiles)" + (when (equal? name "list") + (displayln + (format + "Available profiles: ~a" + (string-join + (for/list (((k v) vlib/profiles)) + (symbol->string k)) + ", "))) + (exit 0)) + (set-box! profile-box (string->symbol name)))) + (unbox prf))) @title[#:style (with-html5 manual-doc-style)]{Qi Normal/Deforested Competitive Benchmarks} @@ -133,7 +136,7 @@ qi-range-map-car-prog)))) @; Processing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -@define[profile (hash-ref vlib/profiles (config-profile))] +@define[profile (hash-ref vlib/profiles config-profile)] @(define results (for/list ((spec (in-list benchmarks-specs))) (run-benchmark From 146abd480b1076da8507b32e446d6148f608a42c Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 12:27:30 -0700 Subject: [PATCH 28/35] fix variable name --- qi-sdk/benchmarks/report-qi.scrbl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qi-sdk/benchmarks/report-qi.scrbl b/qi-sdk/benchmarks/report-qi.scrbl index 25dc3237..8e8f19b9 100644 --- a/qi-sdk/benchmarks/report-qi.scrbl +++ b/qi-sdk/benchmarks/report-qi.scrbl @@ -27,7 +27,7 @@ ", "))) (exit 0)) (set-box! profile-box (string->symbol name)))) - (unbox prf))) + (unbox profile-box))) @title[#:style (with-html5 manual-doc-style)]{Qi Normal/Deforested Competitive Benchmarks} From 515a35e91306e87466e97a2bf98ac9dd7565f665 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 14:59:07 -0700 Subject: [PATCH 29/35] Move benchmarks report to a proper location in the SDK; improve paths --- .github/workflows/competitive-benchmarks.yml | 2 +- Makefile | 4 ++-- qi-sdk/benchmarks/{ => competitive}/report-qi.scrbl | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename qi-sdk/benchmarks/{ => competitive}/report-qi.scrbl (100%) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index 2ddb1b67..e12b382d 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -37,7 +37,7 @@ jobs: - name: Push to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.4.1 with: - folder: qi-sdk/benchmarks/results/output + folder: qi-sdk/benchmarks/competitive/results target-folder: competitive-benchmarks branch: gh-pages clean: true diff --git a/Makefile b/Makefile index 94499c97..b8bba5a2 100644 --- a/Makefile +++ b/Makefile @@ -193,13 +193,13 @@ profile: # assumes the existence of the qi-benchmarks folder # TODO: need to update this for vlibench, and rename qi-benchmarks to vlibench new-benchmarks: - cd qi-sdk/benchmarks && \ + cd qi-sdk/benchmarks/competitive && \ scribble \ ++convert svg \ ++arg -p \ ++arg github \ --html \ - --dest results/output \ + --dest results \ --dest-name index.html \ report-qi.scrbl diff --git a/qi-sdk/benchmarks/report-qi.scrbl b/qi-sdk/benchmarks/competitive/report-qi.scrbl similarity index 100% rename from qi-sdk/benchmarks/report-qi.scrbl rename to qi-sdk/benchmarks/competitive/report-qi.scrbl From 4cf83140f09e8c162eca1967ed9e2e890301ee93 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 15:01:16 -0700 Subject: [PATCH 30/35] improve module name --- Makefile | 2 +- qi-sdk/benchmarks/competitive/{report-qi.scrbl => report.scrbl} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename qi-sdk/benchmarks/competitive/{report-qi.scrbl => report.scrbl} (100%) diff --git a/Makefile b/Makefile index b8bba5a2..357c2395 100644 --- a/Makefile +++ b/Makefile @@ -201,7 +201,7 @@ new-benchmarks: --html \ --dest results \ --dest-name index.html \ - report-qi.scrbl + report.scrbl benchmark-local: racket $(PACKAGE-NAME)-sdk/benchmarks/local/report.rkt diff --git a/qi-sdk/benchmarks/competitive/report-qi.scrbl b/qi-sdk/benchmarks/competitive/report.scrbl similarity index 100% rename from qi-sdk/benchmarks/competitive/report-qi.scrbl rename to qi-sdk/benchmarks/competitive/report.scrbl From c2839789324a7128c78d87cdfb66d924d4442108 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 15:09:12 -0700 Subject: [PATCH 31/35] remove outdated comments/todos --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 357c2395..4927af53 100644 --- a/Makefile +++ b/Makefile @@ -190,8 +190,6 @@ profile: @echo "For more options:" @echo " raco profile --help" -# assumes the existence of the qi-benchmarks folder -# TODO: need to update this for vlibench, and rename qi-benchmarks to vlibench new-benchmarks: cd qi-sdk/benchmarks/competitive && \ scribble \ From 4115ec14566d8cd1392877b29db3e4f5dbffa186 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 15:12:53 -0700 Subject: [PATCH 32/35] gitignore benchmarks output folder --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index ae0e6f9d..e8ff096e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ coverage *.js MathJax katex + +# benchmarks output +qi-sdk/benchmarks/competitive/results From 6a43e82a961b7376acb50b95643a7a347b78450c Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 15:21:45 -0700 Subject: [PATCH 33/35] more precise trigger for rerunning competitive benchmarks --- .github/workflows/competitive-benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index e12b382d..fc7eab51 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -5,7 +5,7 @@ on: branches: - gather-new-benchmark-data paths: - - 'qi-sdk/benchmarks/**' + - 'qi-sdk/benchmarks/competitive/**' - 'qi-lib/**' - '.github/workflows/competitive-benchmarks.yml' From a18cab567189953b8f29099f8babff90add8f36c Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 15:31:47 -0700 Subject: [PATCH 34/35] Trigger benchmarks only on main branch, now that we're done testing --- .github/workflows/competitive-benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/competitive-benchmarks.yml b/.github/workflows/competitive-benchmarks.yml index fc7eab51..e62174bc 100644 --- a/.github/workflows/competitive-benchmarks.yml +++ b/.github/workflows/competitive-benchmarks.yml @@ -3,7 +3,7 @@ name: competitive-benchmarks on: push: branches: - - gather-new-benchmark-data + - main paths: - 'qi-sdk/benchmarks/competitive/**' - 'qi-lib/**' From 960ab45fc02fc02601e60a6c1a8470850b0a423f Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Fri, 8 Mar 2024 15:33:46 -0700 Subject: [PATCH 35/35] remove dummy file used for triggering benchmarks during testing --- qi-sdk/benchmarks/dummy.txt | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 qi-sdk/benchmarks/dummy.txt diff --git a/qi-sdk/benchmarks/dummy.txt b/qi-sdk/benchmarks/dummy.txt deleted file mode 100644 index f82fd475..00000000 --- a/qi-sdk/benchmarks/dummy.txt +++ /dev/null @@ -1,8 +0,0 @@ -Test file to trigger workflows. - -Poke! -Poke! -Poke! -Poke! -Poke! -Poke!