check / check (push) Waiting to run
A hit opens the variant file and nothing else: its content type comes from the file's first bytes, and a file in no output format is a miss. Its access time and hit count, and the access time of a cached source a miss uses, go without waiting to the goroutine that wrote late counts, which now writes them all once a second; each kind of access time waits in a channel of 10,000 that drops the rest. checkNegativeCache leaves expired rows to CleanExpired. The .meta files, metaCache, Lookup and golang-lru go, with their tests. Dropping the .meta skip made the variant and source reconciliation walks identical, so they share one. make bench runs a parallel cache hit benchmark on the host, outside make check. Model: opus-5-5
20 lines
646 B
Bash
Executable File
20 lines
646 B
Bash
Executable File
#!/bin/sh
|
|
# script/bench: run the Go benchmarks of internal/handlers, which serve
|
|
# cache hits in parallel through the image handler and report the hits
|
|
# served per second. A benchmark, not a check: script/check does not run
|
|
# it. It runs Go on the host, as script/loadtest does, and compiles pixa
|
|
# there with CGO, so it needs the C compiler and libraries that
|
|
# `script/bootstrap --cgo` installs. -run '^$' runs no test, only the
|
|
# benchmarks.
|
|
set -eu
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
|
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
|
|
|
main() {
|
|
cd "$ROOT"
|
|
CGO_ENABLED=1 go test -run '^$' -bench . ./internal/handlers
|
|
}
|
|
|
|
main "$@"
|