mirror of
https://github.com/BlackMATov/flat.hpp.git
synced 2025-12-13 01:36:27 +07:00
fix bench scripts
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
"""Script to visualize google-benchmark output"""
|
||||
from __future__ import print_function
|
||||
import argparse
|
||||
@@ -62,6 +62,13 @@ def parse_args():
|
||||
return args
|
||||
|
||||
|
||||
def parse_input_size(name):
|
||||
splits = name.split('/')
|
||||
if len(splits) == 1:
|
||||
return 1
|
||||
return int(splits[1])
|
||||
|
||||
|
||||
def read_data(args):
|
||||
"""Read and process dataframe using commandline args"""
|
||||
try:
|
||||
@@ -71,7 +78,7 @@ def read_data(args):
|
||||
logging.error(msg)
|
||||
exit(1)
|
||||
data['label'] = data['name'].apply(lambda x: x.split('/')[0])
|
||||
data['input'] = data['name'].apply(lambda x: int(x.split('/')[1]))
|
||||
data['input'] = data['name'].apply(parse_input_size)
|
||||
data[args.metric] = data[args.metric].apply(TRANSFORMS[args.transform])
|
||||
return data
|
||||
|
||||
@@ -79,7 +86,7 @@ def read_data(args):
|
||||
def plot_groups(label_groups, args):
|
||||
"""Display the processed data"""
|
||||
for label, group in label_groups.items():
|
||||
plt.plot(group['input'], group[args.metric], label=label)
|
||||
plt.plot(group['input'], group[args.metric], label=label, marker='.')
|
||||
if args.logx:
|
||||
plt.xscale('log')
|
||||
if args.logy:
|
||||
@@ -101,7 +108,7 @@ def main():
|
||||
if args.relative_to is not None:
|
||||
try:
|
||||
baseline = label_groups[args.relative_to][args.metric].copy()
|
||||
except KeyError, key:
|
||||
except KeyError as key:
|
||||
msg = 'Key %s is not present in the benchmark output'
|
||||
logging.error(msg, str(key))
|
||||
exit(1)
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
|
||||
|
||||
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release
|
||||
cd $BUILD_DIR
|
||||
ROOT_DIR="${DIR}/.."
|
||||
BUILD_DIR="${ROOT_DIR}/build/unbench"
|
||||
|
||||
./unbench/flat.hpp.unbench --benchmark_filter=_map_foreach --benchmark_format=csv > benchmark_map_foreach.csv
|
||||
../../scripts/bench_drawer.py -f benchmark_map_foreach.csv
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\
|
||||
-DBUILD_WITH_UNBENCH=ON\
|
||||
-DBUILD_WITH_UNTESTS=OFF)
|
||||
(cd "${BUILD_DIR}" && cmake --build .)
|
||||
|
||||
(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\
|
||||
--benchmark_filter=_map_foreach\
|
||||
--benchmark_format=csv > benchmark_map_foreach.csv)
|
||||
|
||||
(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_map_foreach.csv)
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
|
||||
|
||||
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release
|
||||
cd $BUILD_DIR
|
||||
ROOT_DIR="${DIR}/.."
|
||||
BUILD_DIR="${ROOT_DIR}/build/unbench"
|
||||
|
||||
./unbench/flat.hpp.unbench --benchmark_filter=_map_insert --benchmark_format=csv > benchmark_map_insert.csv
|
||||
../../scripts/bench_drawer.py -f benchmark_map_insert.csv
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\
|
||||
-DBUILD_WITH_UNBENCH=ON\
|
||||
-DBUILD_WITH_UNTESTS=OFF)
|
||||
(cd "${BUILD_DIR}" && cmake --build .)
|
||||
|
||||
(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\
|
||||
--benchmark_filter=_map_insert\
|
||||
--benchmark_format=csv > benchmark_map_insert.csv)
|
||||
|
||||
(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_map_insert.csv)
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
|
||||
|
||||
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release
|
||||
cd $BUILD_DIR
|
||||
ROOT_DIR="${DIR}/.."
|
||||
BUILD_DIR="${ROOT_DIR}/build/unbench"
|
||||
|
||||
./unbench/flat.hpp.unbench --benchmark_filter=_map_lookup --benchmark_format=csv > benchmark_map_lookup.csv
|
||||
../../scripts/bench_drawer.py -f benchmark_map_lookup.csv
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\
|
||||
-DBUILD_WITH_UNBENCH=ON\
|
||||
-DBUILD_WITH_UNTESTS=OFF)
|
||||
(cd "${BUILD_DIR}" && cmake --build .)
|
||||
|
||||
(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\
|
||||
--benchmark_filter=_map_lookup\
|
||||
--benchmark_format=csv > benchmark_map_lookup.csv)
|
||||
|
||||
(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_map_lookup.csv)
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
|
||||
|
||||
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release
|
||||
cd $BUILD_DIR
|
||||
ROOT_DIR="${DIR}/.."
|
||||
BUILD_DIR="${ROOT_DIR}/build/unbench"
|
||||
|
||||
./unbench/flat.hpp.unbench --benchmark_filter=_set_foreach --benchmark_format=csv > benchmark_set_foreach.csv
|
||||
../../scripts/bench_drawer.py -f benchmark_set_foreach.csv
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\
|
||||
-DBUILD_WITH_UNBENCH=ON\
|
||||
-DBUILD_WITH_UNTESTS=OFF)
|
||||
(cd "${BUILD_DIR}" && cmake --build .)
|
||||
|
||||
(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\
|
||||
--benchmark_filter=_set_foreach\
|
||||
--benchmark_format=csv > benchmark_set_foreach.csv)
|
||||
|
||||
(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_set_foreach.csv)
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
|
||||
|
||||
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release
|
||||
cd $BUILD_DIR
|
||||
ROOT_DIR="${DIR}/.."
|
||||
BUILD_DIR="${ROOT_DIR}/build/unbench"
|
||||
|
||||
./unbench/flat.hpp.unbench --benchmark_filter=_set_insert --benchmark_format=csv > benchmark_set_insert.csv
|
||||
../../scripts/bench_drawer.py -f benchmark_set_insert.csv
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\
|
||||
-DBUILD_WITH_UNBENCH=ON\
|
||||
-DBUILD_WITH_UNTESTS=OFF)
|
||||
(cd "${BUILD_DIR}" && cmake --build .)
|
||||
|
||||
(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\
|
||||
--benchmark_filter=_set_insert\
|
||||
--benchmark_format=csv > benchmark_set_insert.csv)
|
||||
|
||||
(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_set_insert.csv)
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )"
|
||||
|
||||
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release
|
||||
cd $BUILD_DIR
|
||||
ROOT_DIR="${DIR}/.."
|
||||
BUILD_DIR="${ROOT_DIR}/build/unbench"
|
||||
|
||||
./unbench/flat.hpp.unbench --benchmark_filter=_set_lookup --benchmark_format=csv > benchmark_set_lookup.csv
|
||||
../../scripts/bench_drawer.py -f benchmark_set_lookup.csv
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\
|
||||
-DBUILD_WITH_UNBENCH=ON\
|
||||
-DBUILD_WITH_UNTESTS=OFF)
|
||||
(cd "${BUILD_DIR}" && cmake --build .)
|
||||
|
||||
(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\
|
||||
--benchmark_filter=_set_lookup\
|
||||
--benchmark_format=csv > benchmark_set_lookup.csv)
|
||||
|
||||
(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_set_lookup.csv)
|
||||
|
||||
Reference in New Issue
Block a user