Skip to content

Commit

Permalink
[benchmarks/compute] Compare against bumpleak variant
Browse files Browse the repository at this point in the history
Allocation is taking over half the runtime!  Gah.

But this is consistent with parsing, as we see in benchmarks/gc.
  • Loading branch information
Andy C committed Nov 8, 2022
1 parent ebde717 commit b8fa35a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions benchmarks/compute.sh
Expand Up @@ -429,13 +429,13 @@ soil-run() {
#devtools/bin.sh make-bin-links

# Test the one that's IN TREE, NOT in ../benchmark-data
local osh_eval=_bin/cxx-opt/osh_eval.stripped
ninja $osh_eval
local -a oil_bin=(_bin/cxx-opt/osh_eval.stripped _bin/cxx-bumpleak/osh_eval)
ninja "${oil_bin[@]}"

local label='no-host'

local provenance
provenance=$(soil-shell-provenance $label $osh_eval)
provenance=$(soil-shell-provenance $label "${oil_bin[@]}")

measure $provenance

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/id.sh
Expand Up @@ -96,7 +96,7 @@ dump-shell-id() {
osh)
$sh --version > $out_dir/osh-version.txt
;;
osh_eval.stripped)
osh_eval|osh_eval.stripped)
# just rely on the stuff above
;;
dash|mksh)
Expand Down
8 changes: 6 additions & 2 deletions benchmarks/report.R
Expand Up @@ -65,6 +65,10 @@ ShellLabels = function(shell_name, shell_hash) {
label = GetOshLabel(shell_hash[i])
} else if (shell_name[i] == 'osh_eval.stripped') {
label = 'oil-native'
} else if (shell_name[i] == '_bin/cxx-opt/osh_eval.stripped') {
label = 'opt/osh_eval'
} else if (shell_name[i] == '_bin/cxx-bumpleak/osh_eval') {
label = 'bumpleak/osh_eval'
} else {
label = shell_name[i]
}
Expand Down Expand Up @@ -584,7 +588,7 @@ ComputeReport = function(in_dir, out_dir) {

# Runtimes are called shells, as a hack for code reuse
times %>%
mutate(shell_name = basename(runtime_name), shell_hash = runtime_hash) %>%
mutate(shell_name = runtime_name, shell_hash = runtime_hash) %>%
select(c(host_name, host_hash, shell_name, shell_hash)) ->
tmp

Expand All @@ -600,7 +604,7 @@ ComputeReport = function(in_dir, out_dir) {

times %>%
select(-c(status, stdout_md5sum, host_hash, runtime_hash)) %>%
mutate(runtime = basename(runtime_name),
mutate(runtime_label = ShellLabels(runtime_name, runtime_hash),
elapsed_ms = elapsed_secs * 1000,
user_ms = user_secs * 1000,
sys_ms = sys_secs * 1000,
Expand Down
2 changes: 1 addition & 1 deletion mycpp/bump_leak_heap.cc
Expand Up @@ -10,7 +10,7 @@
// We need this #ifdef because we don't want the global var in other binaries

#ifdef BUMP_LEAK
char gMemory[MiB(400)]; // 400 MiB of memory, zero'd
char gMemory[MiB(2000)]; // some benchmarks take more than 1 GiB

// This type is for "layout"; it's not instantiated
struct LayoutBlock {
Expand Down
8 changes: 4 additions & 4 deletions mycpp/common.h
Expand Up @@ -33,9 +33,9 @@
inline void log(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
vfprintf(stderr, fmt, args);
va_end(args);
puts("");
fputs("\n", stderr);
}

// I'm not sure why this matters but we get crashes when aligning to 8 bytes.
Expand All @@ -53,9 +53,9 @@ inline size_t aligned(size_t n) {
return (n + kMask) & ~kMask;
}

#define GiB(bytes) (MiB(bytes) * 1024)
#define KiB(bytes) ((bytes) * 1024)
#define MiB(bytes) (KiB(bytes) * 1024)
#define KiB(bytes) ((bytes)*1024)
#define GiB(bytes) (MiB(bytes) * 1024)

const int kMaxRoots = KiB(4);

Expand Down

0 comments on commit b8fa35a

Please sign in to comment.