Skip to content

Commit

Permalink
[benchmarks/vm-baseline] Workaround for exec optmization.
Browse files Browse the repository at this point in the history
Addresses #1072.
  • Loading branch information
Andy C committed Jan 11, 2022
1 parent b1a6869 commit d5509b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion benchmarks/vm-baseline.sh
Expand Up @@ -35,8 +35,9 @@ measure() {
local sh_name=$(basename $sh_path)

# There is a race condition on the status but sleep helps.
# Bug fix: ALIVE to prevent exec optimization in OSH and zsh.
local out="$out_dir/${sh_name}-${shell_hash}.txt"
$sh_path -c 'sleep 0.001; cat /proc/$$/status' > $out
$sh_path -c 'sleep 0.001; cat /proc/$$/status; echo ALIVE' > $out
done

echo
Expand Down

0 comments on commit d5509b8

Please sign in to comment.