mirror of
https://github.com/google/go-jsonnet.git
synced 2025-08-06 22:37:23 +02:00
This pulls in the implementation of substr into native Go instead of interpretted Jsonnet. benchmark old ns/op new ns/op delta Benchmark_Builtin_substr-16 97121527 15115905 -84.44% part of #111
19 lines
618 B
Bash
Executable File
19 lines
618 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
FILTER=${1:-Builtin}
|
|
|
|
root_dir="$( cd "$( dirname "$0" )" && pwd )"
|
|
|
|
(
|
|
cd "${root_dir}"
|
|
mkdir -p ./builtin-benchmark-results
|
|
rm -f ./builtin-benchmark-results/*
|
|
echo "Running Before Test... (10s)"
|
|
go test -bench="${FILTER}" -run=^$ -v -benchtime=10s -jsonnetPath=./jsonnet-old > ./builtin-benchmark-results/before.txt
|
|
echo "Running After Test... (10s)"
|
|
go test -bench="${FILTER}" -run=^$ -v -benchtime=10s -jsonnetPath=./jsonnet > ./builtin-benchmark-results/after.txt
|
|
benchcmp ./builtin-benchmark-results/before.txt ./builtin-benchmark-results/after.txt
|
|
)
|