Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++17 lambda + parallel #154

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def load_config():
profile['name'] = name
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this line be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Just because we are defining ${name} as meaning "name without the front part" does not mean we can leave it undefined in the dict.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But won't there be multiple name arguments passed into safe_substitute?

for k, v in zip(profile, profile.values()):
if type(v) is str:
profile[k] = Template(v).safe_substitute(**profile)
profile[k] = Template(v).safe_substitute(
**profile, name=name.split(':', 1)[0])
ret_items[name] = profile
return ret_items, options

Expand Down
50 changes: 24 additions & 26 deletions benchmark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,27 @@ cmd = ["zsh", "./swapview.sh"]

[item."C++17"]

[item."C++17:par"]
cmd = ["./swapview-par"]

[item."C++17:par-lam"]
cmd = ["./swapview-par-lam"]

[item."C++17:lam"]
cmd = ["./swapview-lam"]

[item."C++98"]

[item."C++98_omp"]
[item."C++98:omp"]
cmd = ["./swapview_omp"]
dir = "C++98"

[item.Crystal]

[item.Crystal_fiber]
[item.Crystal:fiber]
cmd = ["./swapview_fiber"]
dir = "Crystal"

[item.Crystal_process]
[item.Crystal:process]
cmd = ["./swapview_process"]
dir = "Crystal"

[item.CSharp]
cmd = ["mono-sgen", "--desktop", "SwapView.exe"]
Expand All @@ -81,15 +87,13 @@ cmd = ["python", "-c", "import swapview"]

[item.D]

[item.D_llvm]
[item.D:llvm]
cmd = ["./swapview-llvm"]
dir = "D"

[item.D_parallel]

[item.D_parallel_llvm]
[item.D_parallel:llvm]
cmd = ["./swapview-llvm"]
dir = "D_parallel"

[item.Dart]
cmd = ["dart", "swapview.dart"]
Expand Down Expand Up @@ -118,30 +122,28 @@ cmd = ["java", "-dsa", "-Xmixed", "-XX:CompileThreshold=4096", "-XX:+TieredCompi
[item.Julia]
cmd = ["./swapview.jl"]

[item.Lua51]
[item.Lua:51]
cmd = ["lua5.1", "swapview.lua"]
dir = "Lua"

[item.Lua52]
[item.Lua:52]
cmd = ["lua5.2", "swapview.lua"]
dir = "Lua"

[item.Lua53]
[item.Lua:53]
cmd = ["lua", "swapview.lua"]
dir = "Lua"

[item.LuaJIT]
[item.Lua:JIT]
cmd = ["luajit", "swapview.lua"]
dir = "Lua"

[item.Nim]

# TODO: Rename it so we don't have this exception here.
[item.NodeJS]
cmd = ["./swapview.js"]

[item.NodeJS_async]
cmd = ["./swapview.js"]

# TODO: check permissions on this.
[item.NodeJS_cluster]
cmd = ["node", "swapview.js"]

Expand All @@ -155,13 +157,11 @@ cmd = ["./swapview.pl"]
[item.PHP]
cmd = ["./swapview.php"]

[item.Python2]
[item.Python:2]
cmd = ["python2", "swapview.py"]
dir = "Python"

[item.Python3]
[item.Python:3]
cmd = ["python3", "swapview.py"]
dir = "Python"

[item.Python3_bytes]
cmd = ["python3", "swapview.py"]
Expand All @@ -188,15 +188,13 @@ cmd = ["./swapview.r"]
[item.Racket]
cmd = ["./swapview.rkt"]

[item.Racket_compiled]
dir = "Racket"
[item.Racket:compiled]
cmd = ["racket", "compiled/swapview_rkt.zo"]

[item.Ruby]
cmd = ["./swapview.rb"]

[item.Ruby_rubinius]
dir = "Ruby"
[item.Ruby:rubinius]
cmd = ["rbx", "swapview.rb"]

[item.Rust]
Expand Down
4 changes: 3 additions & 1 deletion benchmark/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ fn merge_default(item: OptionalBenchmarkItem, default: &Option<OptionalBenchmark
format!("{} doesn't have required field valid_percent", name))?;
}

let expanded_dir = dir.replace("$name", &item.name);
// Apply the only relevant Python template-string syntax here.
let name_fst = &item.name.split_at(':').0;
let expanded_dir = dir.replace("$name", name_fst);
Ok(BenchmarkItem{
name: item.name, dir: expanded_dir, cmd: cmd,
time_limit: time_limit,
Expand Down