<commit_before>#!/bin/bash

# Run run_bench.escript, coloring the output according to the type of operation.

erlc -smp gen_bench.erl

escript run_bench.escript | awk '
$1 ~ /^lookup|^get|^fetch/ {print "\033[1;32m" $0 "\033[m"; next}
$1 ~ /^iterate_/ {print "\033[33m" $0 "\033[m"; next}
$1 ~ /^store|^insert|^keystore/ {print "\033[1;34m" $0 "\033[m"; next}
$1 ~ /^delete|^erase/ {print "\033[35m" $0 "\033[m"; next}
{print}
'<commit_msg>Added comments, added 'set -e' to exit on all errors, and added highlighting of table headers.<commit_after>#!/bin/bash

# Run run_bench.escript, coloring the output according to the type of operation.

# Exit on all errors.
set -e

# Recompile, just in case.
erlc -smp gen_bench.erl

escript run_bench.escript | awk '
/Operation *Total \(us\) *Average \(us\)/ {print "\033[1m" $0 "\033[m"; next}
$1 ~ /^lookup|^get|^fetch/ {print "\033[1;32m" $0 "\033[m"; next}
$1 ~ /^iterate_/ {print "\033[33m" $0 "\033[m"; next}
$1 ~ /^store|^insert|^keystore/ {print "\033[1;34m" $0 "\033[m"; next}
$1 ~ /^delete|^erase/ {print "\033[35m" $0 "\033[m"; next}
{print}
'
{'fraction_non_alphanumeric': 0.21350364963503649, 'fraction_numerical': 0.08394160583941605, 'mean_word_length': 4.1745283018867925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2232489', 'n_tokens_mistral': 495, 'n_tokens_neox': 436, 'n_words': 129}