forked from oils-for-unix/oils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmycpp.sh
executable file
·83 lines (55 loc) · 1.24 KB
/
mycpp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
#
# Analyze how mycpp speeds up programs.
#
# Usage:
# benchmarks/mycpp.sh <function name>
set -o nounset
set -o pipefail
set -o errexit
REPO_ROOT=$(cd $(dirname $0)/.. && pwd)
readonly REPO_ROOT
source benchmarks/common.sh
source test/tsv-lib.sh # tsv2html
print-report() {
local in_dir=$1
benchmark-html-head 'mycpp Code Generation'
cat <<EOF
<body class="width60">
<p id="home-link">
<a href="/">oilshell.org</a>
</p>
EOF
cmark <<EOF
## mycpp Code Generation
Measure the speedup from mycpp, and the resource usage.
Source code: [oil/mycpp/examples](https://github.com/oilshell/oil/tree/master/mycpp/examples)
EOF
cmark <<EOF
### User Time (milliseconds)
Lower ratios are better.
EOF
tsv2html $in_dir/user_time.tsv
cmark <<EOF
### Max Resident Set Size (MB)
Lower ratios are better. We use MB (powers of 10), not MiB (powers of 2).
EOF
tsv2html $in_dir/max_rss.tsv
if false; then
cmark <<EOF
### Details
EOF
tsv2html $in_dir/details.tsv
fi
cmark <<'EOF'
### TODO
- Benchmark with both GCC and Clang, and show compiler provenance. Right now
the compiler is forced to be the system `c++`.
- Run this benchmark on multiple machines.
EOF
cat <<EOF
</body>
</html>
EOF
}
"$@"