-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into shift-opcodes
- Loading branch information
Showing
16 changed files
with
168 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,10 @@ version = "0.0.0" | |
license = "Apache-2.0" | ||
authors = ["Stewart Mackenzie <[email protected]>", "Wei Tang <[email protected]>"] | ||
|
||
[[bench]] | ||
name = "performance" | ||
harness = false | ||
|
||
[dependencies] | ||
sputnikvm = { path = '..' } | ||
jsontests-derive = { path = "./jsontests-derive" } | ||
|
@@ -14,7 +18,7 @@ lazy_static = "0.2" | |
env_logger = "0.5.11" | ||
sha3 = "0.6" | ||
etcommon-rlp = { version = "0.2", default-features = false } | ||
|
||
criterion = "0.2.5" | ||
|
||
[features] | ||
default = [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
#![cfg(feature = "bench")] | ||
#![feature(test)] | ||
#![allow(non_snake_case)] | ||
|
||
#[macro_use] | ||
extern crate jsontests_derive; | ||
extern crate jsontests; | ||
extern crate test; | ||
#[macro_use] | ||
extern crate criterion; | ||
|
||
use criterion::Criterion; | ||
use std::time::Duration; | ||
|
||
#[derive(JsonTests)] | ||
#[directory = "jsontests/res/files/vmPerformance"] | ||
#[directory = "jsontests/res/files/eth/VMTests/vmPerformance"] | ||
#[test_with = "jsontests::util::run_test"] | ||
#[bench_with = "jsontests::util::run_bench"] | ||
#[criterion_config = "criterion_cfg"] | ||
struct Performance; | ||
|
||
|
||
pub fn criterion_cfg() -> Criterion { | ||
// Due to poor SputnikVM performance, there's no chance to get a lot of measurements | ||
// and higher threshold is needed | ||
Criterion::default() | ||
.sample_size(2) | ||
.measurement_time(Duration::from_secs(10)) | ||
.noise_threshold(0.07) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ quote = "0.3" | |
serde_json = "1.0" | ||
failure = "0.1.2" | ||
itertools = "0.7.8" | ||
criterion = "0.2.5" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
use serde_json::Value; | ||
use serde_json as json; | ||
use test_transaction; | ||
use bench_transaction; | ||
|
||
pub fn run_test(name: &str, test: &str) { | ||
let test: Value = json::from_str(test).unwrap(); | ||
assert_eq!(test_transaction(name, &test, true), Ok(true)); | ||
} | ||
|
||
#[cfg(feature = "bench")] | ||
use test::Bencher; | ||
use criterion::Criterion; | ||
|
||
#[cfg(feature = "bench")] | ||
pub fn run_bench(b: &mut Bencher, name: &str, test: &str) { | ||
pub fn run_bench(c: &mut Criterion, name: &'static str, test: &str) { | ||
let test: Value = json::from_str(test).unwrap(); | ||
b.iter(|| { | ||
// TODO: adjust test_transaction or write another function | ||
// TODO: in order to start benchmark as close to actual sputnik code as possible | ||
assert_eq!(test_transaction(name, &test, true), Ok(true)); | ||
}) | ||
bench_transaction(name, test, c); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "sputnikvm-network-classic" | ||
version = "0.10.0" | ||
version = "0.10.1" | ||
description = "Ethereum Classic patches for SputnikVM." | ||
license = "Apache-2.0" | ||
authors = ["Wei Tang <[email protected]>"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "sputnikvm-network-ellaism" | ||
version = "0.10.0" | ||
version = "0.10.1" | ||
description = "Ellaism patches for SputnikVM." | ||
license = "Apache-2.0" | ||
authors = ["Wei Tang <[email protected]>"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
[package] | ||
name = "sputnikvm-network-expanse" | ||
version = "0.10.0" | ||
version = "0.10.1" | ||
description = "Expanse patches for SputnikVM." | ||
license = "Apache-2.0" | ||
authors = ["Wei Tang <[email protected]>"] | ||
repository = "https://github.com/ethereumproject/sputnikvm" | ||
|
||
[dependencies] | ||
sputnikvm = { version = "0.10", path = "../..", default-features = false } | ||
sputnikvm-precompiled-bn128 = { version = "0.10", path = "../../precompiled/bn128", default-features = false} | ||
sputnikvm-precompiled-modexp = { version = "0.10", path = "../../precompiled/modexp", default-features = false } | ||
sputnikvm-precompiled-bn128 = { version = "0.10.1", path = "../../precompiled/bn128", default-features = false} | ||
sputnikvm-precompiled-modexp = { version = "0.10.1", path = "../../precompiled/modexp", default-features = false } | ||
etcommon-bigint = { version = "0.2", default-features = false } | ||
|
||
[features] | ||
|
Oops, something went wrong.