Last active
September 6, 2020 21:05
-
-
Save ajfriend/40e65e949bff016b1cbe87051252efa0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rm -rf build | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Release .. | |
make | |
make benchmarks > out.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def readout(name='out.txt', as_df=False): | |
lines = open(name).read() | |
lines = lines.replace('microseconds', '#') | |
lines = lines.split('\n') | |
lines = (l.strip() for l in lines) | |
lines = (l[3:] for l in lines if l[:3] == '-- ') | |
lines = (l.split('#')[0] for l in lines) | |
lines = (l.split(':') for l in lines) | |
out = [(name, float(val)) for name, val in lines] | |
out = sorted(out) | |
if as_df: | |
out = pd.DataFrame(out) | |
out.columns = ['name', 'ms'] | |
return out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment