<script language="javascript" type="text/javascript" src="jquery.flot.categories.js"></script>
<script language="javascript" type="text/javascript" src="bench.js"></script>
<script language="javascript" type="text/javascript" src="plot.js"></script>
+ <script language="javascript" type="text/javascript" src="tables.js"></script>
</head>
<body>
<div class="demo-container">
<div id="encode" class="demo-placeholder"></div>
</div>
- <p>encode: Y = GB/s, X = K/M</p>
+ <h2>Encode:</h2>
+ <p>Y = GB/s, X = K/M</p>
+ <details>
+ <summary>Bench Data</summary>
+ <table id="encode-table">
+ <tr>
+ <th>Plugin</th>
+ <th>Technique</th>
+ <th>Time</th>
+ <th>Total Size</th>
+ <th>k</th>
+ <th>m</th>
+ <th>Iteration</th>
+ <th>Packet Size</th>
+ </tr>
+ </table>
+ </details>
<div class="demo-container">
<div id="decode" class="demo-placeholder"></div>
</div>
- <p>decode: Y = GB/s, X = K/M/erasures</p>
+ <h2>Decode:</h2>
+ <p>Y = GB/s, X = K/M/erasures</p>
+ <details>
+ <summary>Bench Data</summary>
+ <table id="decode-table">
+ <tr>
+ <th>Plugin</th>
+ <th>Technique</th>
+ <th>Time</th>
+ <th>Total Size</th>
+ <th>k</th>
+ <th>m</th>
+ <th>Iteration</th>
+ <th>Packet Size</th>
+ <th>Erasures</th>
+ </tr>
+ </table>
+ </details>
</div>
: ${CEPH_ERASURE_CODE_BENCHMARK:=ceph_erasure_code_benchmark}
: ${PLUGIN_DIRECTORY:=/usr/lib/ceph/erasure-code}
: ${PLUGINS:=isa jerasure}
-: ${TECHNIQUES:=vandermonde cauchy}
+: ${TECHNIQUES:=vandermonde cauchy liberation reed_sol_r6_op blaum_roth liber8tion}
: ${TOTAL_SIZE:=$((1024 * 1024))}
: ${SIZE:=4096}
: ${PARAMETERS:=--parameter jerasure-per-chunk-alignment=true}
+declare -rA isa_techniques=(
+ [vandermonde]="reed_sol_van"
+ [cauchy]="cauchy"
+)
+
+declare -rA jerasure_techniques=(
+ [vandermonde]="reed_sol_van"
+ [cauchy]="cauchy_good"
+ [reed_sol_r6_op]="reed_sol_r6_op"
+ [blaum_roth]="blaum_roth"
+ [liberation]="liberation"
+ [liber8tion]="liber8tion"
+)
+
function bench_header() {
echo -e "seconds\tKB\tplugin\tk\tm\twork.\titer.\tsize\teras.\tcommand."
}
echo $p
}
+function get_technique_name()
+{
+ local plugin=$1
+ local technique=$2
+
+ declare -n techniques="${plugin}_techniques"
+ echo ${techniques["$technique"]}
+}
+
+function technique_is_raid6() {
+ local technique=$1
+ local r6_techniques="liberation reed_sol_r6_op blaum_roth liber8tion"
+
+ if [[ $r6_techniques =~ $technique ]]; then
+ return 0
+ fi
+ return 1
+}
+
function bench_run() {
local plugin=jerasure
local w=8
k2ms[4]="2 3"
k2ms[6]="2 3 4"
k2ms[10]="3 4"
- local isa2technique_vandermonde='reed_sol_van'
- local isa2technique_cauchy='cauchy'
- local jerasure2technique_vandermonde='reed_sol_van'
- local jerasure2technique_cauchy='cauchy_good'
+
for technique in ${TECHNIQUES} ; do
for plugin in ${PLUGINS} ; do
- eval technique_parameter=\$${plugin}2technique_${technique}
+ technique_parameter=$(get_technique_name $plugin $technique)
+ if [[ -z $technique_parameter ]]; then continue; fi
echo "serie encode_${technique}_${plugin}"
for k in $ks ; do
for m in ${k2ms[$k]} ; do
+ if [ $m -ne 2 ] && technique_is_raid6 $technique; then continue; fi
bench $plugin $k $m encode $(($TOTAL_SIZE / $SIZE)) $SIZE 0 \
--parameter packetsize=$(packetsize $k $w $VECTOR_WORDSIZE $SIZE) \
${PARAMETERS} \
--parameter technique=$technique_parameter
-
done
done
done
done
for technique in ${TECHNIQUES} ; do
for plugin in ${PLUGINS} ; do
- eval technique_parameter=\$${plugin}2technique_${technique}
+ technique_parameter=$(get_technique_name $plugin $technique)
+ if [[ -z $technique_parameter ]]; then continue; fi
echo "serie decode_${technique}_${plugin}"
for k in $ks ; do
for m in ${k2ms[$k]} ; do
+ if [ $m -ne 2 ] && technique_is_raid6 $technique; then continue; fi
echo
for erasures in $(seq 1 $m) ; do
bench $plugin $k $m decode $(($TOTAL_SIZE / $SIZE)) $SIZE $erasures \
}
function fplot() {
- local serie
- bench_run | while read seconds total plugin k m workload iteration size erasures rest ; do
+ local serie=""
+ local plot=""
+ local encode_table="var encode_table = [\n"
+ local decode_table="var decode_table = [\n"
+ while read seconds total plugin k m workload iteration size erasures rest ; do
if [ -z $seconds ] ; then
- echo null,
+ plot="$plot null,\n"
elif [ $seconds = serie ] ; then
if [ "$serie" ] ; then
- echo '];'
+ echo -e "$plot];\n"
fi
local serie=`echo $total | sed 's/cauchy_\([0-9]\)/cauchy_good_\1/g'`
- echo "var $serie = ["
+ plot="var $serie = [\n"
else
local x
+ local row
+ local technique=`echo $rest | grep -Po "(?<=technique=)\w*"`
+ local packetsize=`echo $rest | grep -Po "(?<=packetsize=)\w*"`
if [ $workload = encode ] ; then
x=$k/$m
+ row="[ '$plugin', '$technique', $seconds, $total, $k, $m, $iteration, $packetsize ],"
+ encode_table="$encode_table $row\n"
+
else
x=$k/$m/$erasures
+ row="[ '$plugin', '$technique', $seconds, $total, $k, $m, $iteration, $packetsize, $erasures ],"
+ decode_table="$decode_table $row\n"
fi
- echo "[ '$x', " $(echo "( $total / 1024 / 1024 ) / $seconds" | bc -ql) " ], "
+ local out_time="$(echo "( $total / 1024 / 1024 ) / $seconds" | bc -ql)"
+ plot="$plot [ '$x', $out_time ],\n"
fi
- done
- echo '];'
+ done < <(bench_run)
+
+ echo -e "$plot];\n"
+ echo -e "$encode_table];\n"
+ echo -e "$decode_table];\n"
}
function main() {
.legend table {
border-spacing: 5px;
-}
\ No newline at end of file
+}
+
+#encode-table, #decode-table {
+ margin: 0px 0px 15px 15px;
+ font-size: 12px;
+ border-collapse: collapse;
+ width: 100%;
+}
+
+#encode-table td, #decode-table td, #encode-table th, #decode-table th {
+ border: 1px solid #ddd;
+ padding: 4px;
+}
+
+#encode-table th, #decode-table th {
+ padding-top: 4px;
+ padding-bottom: 4px;
+ text-align: left;
+}
lines: { show: true },
});
}
+ if (typeof encode_reed_sol_r6_op_jerasure != 'undefined') {
+ encode.push({
+ data: encode_reed_sol_r6_op_jerasure,
+ label: "Jerasure, Reed Solomon RAID6",
+ points: { show: true },
+ lines: { show: true },
+ });
+ }
+ if (typeof encode_liberation_jerasure != 'undefined') {
+ encode.push({
+ data: encode_liberation_jerasure,
+ label: "Jerasure, Liberation",
+ points: { show: true },
+ lines: { show: true },
+ });
+ }
+ if (typeof encode_liber8tion_jerasure != 'undefined') {
+ encode.push({
+ data: encode_liber8tion_jerasure,
+ label: "Jerasure, Liber8tion",
+ points: { show: true },
+ lines: { show: true },
+ });
+ }
+ if (typeof encode_blaum_roth_jerasure != 'undefined') {
+ encode.push({
+ data: encode_blaum_roth_jerasure,
+ label: "Jerasure, Blaum Roth",
+ points: { show: true },
+ lines: { show: true },
+ });
+ }
$.plot("#encode", encode, {
xaxis: {
mode: "categories",
lines: { show: true },
});
}
+ if (typeof decode_reed_sol_r6_op_jerasure != 'undefined') {
+ decode.push({
+ data: decode_reed_sol_r6_op_jerasure,
+ label: "Jerasure, Reed Solomon RAID6",
+ points: { show: true },
+ lines: { show: true },
+ });
+ }
+ if (typeof decode_liberation_jerasure != 'undefined') {
+ decode.push({
+ data: decode_liberation_jerasure,
+ label: "Jerasure, Liberation",
+ points: { show: true },
+ lines: { show: true },
+ });
+ }
+ if (typeof decode_liber8tion_jerasure != 'undefined') {
+ decode.push({
+ data: decode_liber8tion_jerasure,
+ label: "Jerasure, Liber8tion",
+ points: { show: true },
+ lines: { show: true },
+ });
+ }
+ if (typeof decode_blaum_roth_jerasure != 'undefined') {
+ decode.push({
+ data: decode_blaum_roth_jerasure,
+ label: "Jerasure, Blaum Roth",
+ points: { show: true },
+ lines: { show: true },
+ });
+ }
$.plot("#decode", decode, {
xaxis: {
mode: "categories",
tickLength: 0
},
});
-
});
--- /dev/null
+$(function() {
+ if (typeof encode_table != 'undefined') {
+ let table_rows = '';
+ for (let row of encode_table) {
+ table_rows += `<tr>`
+ for (let cell of row)
+ {
+ table_rows += `<td>${cell}</td>`
+ }
+ table_rows += `</tr>`;
+ console.log(table_rows);
+ }
+ $('#encode-table').append(table_rows);
+ }
+
+ if (typeof decode_table != 'undefined') {
+ let table_rows = '';
+ for (let row of decode_table) {
+ table_rows += `<tr>`
+ for (let cell of row)
+ {
+ table_rows += `<td>${cell}</td>`
+ }
+ table_rows += `</tr>`;
+ }
+ $('#decode-table').append(table_rows);
+ }
+});
\ No newline at end of file