From fa118dc8397fcec1751f37ecb7668aeefc7e4f90 Mon Sep 17 00:00:00 2001 From: "Matthew \"strager\" Glazar" Date: Thu, 26 Oct 2023 17:06:47 -0700 Subject: [PATCH] feat(tools): add script to run benchmarks on straglum Make my life easier by automating a lot of the work of running LSP benchmarks. --- tools/run-benchmarks-straglum.sh | 98 ++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 tools/run-benchmarks-straglum.sh diff --git a/tools/run-benchmarks-straglum.sh b/tools/run-benchmarks-straglum.sh new file mode 100755 index 0000000000..99e007a237 --- /dev/null +++ b/tools/run-benchmarks-straglum.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +# Copyright (C) 2020 Matthew "strager" Glazar +# See end of file for extended copyright information. + +# This script runs LSP benchmarks on strager's straglum laptop for the +# website: https://quick-lint-js.com/benchmarks/ + +set -e +set -u + +sudo cpupower frequency-set --governor performance + +. ~/tmp/Projects/nvm/nvm.sh +nvm install node +nvm use node +npm install -g yarn + +CXX=g++-10 CXXFLAGS=-fcoroutines cmake -S . -B build -G Ninja -DQUICK_LINT_JS_ENABLE_BENCHMARKS=1 -DCMAKE_BUILD_TYPE=Release +ninja -C build quick-lint-js-benchmark-lsp-servers + +cd benchmark/benchmark-lsp/ + +( + cd eslint/ + yarn + cd node_modules/vscode-eslint/ + npm ci && npm run compile:server +) + +( + cd flow/ + yarn +) + +( + cd typescript/ + yarn +) + +sudo apt-get update +sudo apt-get install --yes quick-lint-js + +( + cd biome/ + yarn +) + +( + cd ~/tmp/Projects/RSLint/ + cargo build --release +) + +PATH="${HOME}/tmp/Projects/RSLint/target/release/:${PATH}" +PATH="${HOME}/bin/:${PATH}" # For Deno. + +cool_down_cpu() { + sleep 10 +} + +cool_down_cpu +../../build/benchmark/benchmark-lsp/quick-lint-js-benchmark-lsp-servers \ + --iterations 10 \ + --samples 10 \ + --output-json ../../website/public/benchmarks/full-change-wait-express-router-js.json \ + full-change-wait/express-router.js + +cool_down_cpu +../../build/benchmark/benchmark-lsp/quick-lint-js-benchmark-lsp-servers \ + --iterations 10 \ + --samples 10 \ + --output-json ../../website/public/benchmarks/incremental-change-wait-express-router-js.json \ + incremental-change-wait/express-router.js + +cool_down_cpu +../../build/benchmark/benchmark-lsp/quick-lint-js-benchmark-lsp-servers \ + --iterations 10 \ + --samples 10 \ + --output-json ../../website/public/benchmarks/incremental-change-wait-react-quickly-ch10-jsx.json \ + incremental-change-wait/react-quickly-ch10.jsx + +# quick-lint-js finds bugs in JavaScript programs. +# Copyright (C) 2020 Matthew "strager" Glazar +# +# This file is part of quick-lint-js. +# +# quick-lint-js is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# quick-lint-js is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with quick-lint-js. If not, see .