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

Refactor old function with new function object #255

Merged
merged 1 commit into from
May 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
66 changes: 16 additions & 50 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
"type": "process",
"label": "Cargo Run",
"command": "cargo",
"args": [
"run",
"./tests/js/test.js"
],
"problemMatcher": [
"$rustc"
],
"args": ["run", "./tests/js/test.js"],
"problemMatcher": ["$rustc"],
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"env": { "RUST_BACKTRACE": "full" }
},
"presentation": {
"clear": true
}
Expand All @@ -26,19 +24,9 @@
"type": "process",
"label": "Get Tokens",
"command": "cargo",
"args": [
"run",
"--",
"-t=Debug",
"./tests/js/test.js"
],
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
"isDefault": true
},
"args": ["run", "--", "-t=Debug", "./tests/js/test.js"],
"problemMatcher": ["$rustc"],
"group": "build",
"presentation": {
"clear": true
}
Expand All @@ -47,19 +35,9 @@
"type": "process",
"label": "Get AST",
"command": "cargo",
"args": [
"run",
"--",
"-a=Debug",
"./tests/js/test.js"
],
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
"isDefault": true
},
"args": ["run", "--", "-a=Debug", "./tests/js/test.js"],
"problemMatcher": ["$rustc"],
"group": "build",
"presentation": {
"clear": true
}
Expand All @@ -68,12 +46,8 @@
"type": "process",
"label": "Cargo Test",
"command": "cargo",
"args": [
"test"
],
"problemMatcher": [
"$rustc"
],
"args": ["test"],
"problemMatcher": ["$rustc"],
"group": {
"kind": "test",
"isDefault": true
Expand All @@ -86,17 +60,9 @@
"type": "process",
"label": "Cargo Test Build",
"command": "cargo",
"args": [
"test",
"--no-run"
],
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
"isDefault": true
}
"args": ["test", "--no-run"],
"problemMatcher": ["$rustc"],
"group": "build"
}
]
}
43 changes: 22 additions & 21 deletions boa/benches/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,30 @@ fn symbol_creation(c: &mut Criterion) {
});
}

static FOR_LOOP: &str = r#"
let a = 10;
let b = "hello";
for (;;) {
a += 5;
// TODO: implement for loops.
// static FOR_LOOP: &str = r#"
// let a = 10;
// let b = "hello";
// for (;;) {
// a += 5;

if a < 50 {
b += "world";
}
// if (a < 50) {
// b += "world";
// }

if (a > 100) {
break;
}
}
let c = a;
let d = b;
"#;
// if (a > 100) {
// break;
// }
// }
// let c = a;
// let d = b;
// "#;

fn for_loop_execution(c: &mut Criterion) {
c.bench_function("For loop (Execution)", move |b| {
b.iter(|| exec(black_box(FOR_LOOP)))
});
}
// fn for_loop_execution(c: &mut Criterion) {
// c.bench_function("For loop (Execution)", move |b| {
// b.iter(|| exec(black_box(FOR_LOOP)))
// });
// }

static FIBONACCI: &str = r#"
let num = 12;
Expand All @@ -73,7 +74,7 @@ criterion_group!(
execution,
create_realm,
symbol_creation,
for_loop_execution,
// for_loop_execution,
fibonacci
);
criterion_main!(execution);
Loading