Commit graph

21 commits

Author SHA1 Message Date
Fabian Boehm
ae24d98356 benchmarks: Run glob only once
We assume that you use something like hyperfine to run warmups, like
our driver script does.

This allows the script to be run e.g. in valgrind without being too
much of a pain in the gluteus.
2024-01-07 19:33:15 +01:00
Fabian Boehm
a913702b63 Add more benchmarks 2023-06-01 18:15:42 +02:00
Fabian Boehm
0ede48e024 benchmarks: Do hyperfine first
Helps with warmup
2022-09-25 13:27:01 +02:00
Fabian Boehm
f4797a0133 benchmarks: Use --no-config
It's existed since 3.3.0, so now seems to be an acceptable time to add
it.

(also adjust some repetitions a bit so they don't take too long)
2022-09-24 13:36:24 +02:00
Johannes Altmanninger
5211735965 benchmarks/driver.sh: also quote path to benchmarks
I had only tested with a space in the path to the fish binary, but
not with a space in the path to the repository.

Closes #8559
2021-12-20 06:48:00 +01:00
Johannes Altmanninger
db7bea1a3e benchmarks/driver.sh: quote path to fish if necessary
To allow paths with spaces, give a shell-quoted path to hyperfine. We
could make this a bit shorter by quoting as early as possible, like

	FISH_PATH=$(quote "$1")

and then use $FISH_PATH unquoted. I discarded that idea because it
probably looks surprising.

Closes #8559
2021-12-19 11:51:45 +01:00
Ilan Cosman
566a673e4f Run fish_indent on all non-test .fish files 2021-11-23 09:49:45 +01:00
Fabian Homborg
c444ee2e6a benchmarks: Add globbing 2021-10-25 18:42:18 +02:00
Fabian Homborg
1083cd2640 Benchmarks: Make seq_echo benchmark longer
This took ~12ms on my system, which is too short to see much more than
startup time.
2020-12-15 18:17:13 +01:00
Fabian Homborg
b4cf910e55 Add a benchmark for math
Results after 14908322a9, compared to 3.1.2:

math.fish
fish
  rusage self:
      user time: 916 ms
       sys time: 39 ms
     total time: 955 ms
        max rss: 35028 kb
        signals: 0
build/fish
  rusage self:
      user time: 769 ms
       sys time: 60 ms
     total time: 829 ms
        max rss: 34868 kb
        signals: 0
Benchmark #1: fish benchmarks/benchmarks/math.fish > /dev/null
  Time (mean ± σ):     955.2 ms ±  32.5 ms    [User: 897.2 ms, System: 57.9 ms]
  Range (min … max):   896.3 ms … 1002.5 ms    10 runs

Benchmark #2: build/fish benchmarks/benchmarks/math.fish > /dev/null
  Time (mean ± σ):     840.3 ms ±  21.5 ms    [User: 784.4 ms, System: 54.8 ms]
  Range (min … max):   802.4 ms … 869.0 ms    10 runs

Summary
  'build/fish benchmarks/benchmarks/math.fish > /dev/null' ran
    1.14 ± 0.05 times faster than 'fish benchmarks/benchmarks/math.fish > /dev/null'
2020-12-15 08:09:39 +01:00
Fabian Homborg
796d92b4e9 benchmark driver: Allow passing a second fish path to compare
[ci skip]
2020-09-21 20:58:39 +02:00
Fabian Homborg
9367d4ff71 Reindent functions to remove useless quotes
This does not include checks/function.fish because that currently
includes a "; end" in a message that indent would remove, breaking the test.
2020-03-09 19:46:43 +01:00
Fabian Homborg
115892ccd2 alias: Use read --tokenize
This did some weird unescaping to try to extract the first word.

So we're now more likely to be *correct*, and the alias benchmark is
about 20% *faster*.

Call it a win-win.
2019-12-01 18:14:26 +01:00
Rosen Penev
87e24db5ef driver.sh: Run through shellcheck 2019-11-28 20:26:01 +01:00
Fabian Homborg
9a3fb3e265 Use POSIX sh in the benchmark driver
There are reasons to use bash, `hash` is not one of them, as `command
-v` is perfectly capable and in POSIX.

[ci skip]
2019-11-27 16:21:11 +01:00
ridiculousfish
efe6fb3c3b Use hyperfine in the benchmark driver if available 2019-11-26 11:10:04 -08:00
ridiculousfish
03a289c9ef Add an aliases benchmark 2019-11-23 11:53:49 -08:00
Fabian Homborg
7ddae68645 Restyle a few stragglers
THERE WERE TABS! TABS!

TABS!

[ci skip]
2019-05-20 21:07:37 +02:00
David Adam
4d8a82b68f benchmarks: use true executable in path
true is /bin/true on some Linux and /usr/bin/true on macOS.

[ci skip]
2019-04-17 18:31:19 +08:00
ridiculousfish
e634abc1c8 Add a benchmark for external commands
This just runs '/usr/bin/true' a lot.
2019-04-13 12:40:09 -07:00
ridiculousfish
2d4872ba60 Add a benchmark driver and a simple benchmark
This adds a simple script that drives benchmarks, and a simple sample
benchmark.
2019-04-10 14:34:25 -07:00