Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

[ci benches]: use all-features #11496

Merged
merged 4 commits into from
Feb 17, 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
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ cargo-check-benches:
stage: test
<<: *docker-cache-status
script:
- time cargo check --all --benches --target $CARGO_TARGET --locked --verbose --color=always
- time cargo check --workspace --benches --target $CARGO_TARGET --locked --verbose --color=always --all-features
- sccache --show-stats

cargo-audit:
Expand Down
7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@ slow-blocks = ["ethcore/slow-blocks"]
secretstore = ["parity-secretstore", "accounts", "ethabi", "ethcore-call-contract"]
final = ["parity-version/final"]
deadlock_detection = ["parking_lot/deadlock_detection"]
# to create a memory profile (requires nightly rust), use e.g.
# `heaptrack /path/to/parity <parity params>`,
# to visualize a memory profile, use `heaptrack_gui`
# or
# `valgrind --tool=massif /path/to/parity <parity params>`
# and `massif-visualizer` for visualization
memory_profiling = []
Copy link
Collaborator Author

@niklasad1 niklasad1 Feb 16, 2020

Choose a reason for hiding this comment

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

//cc @ordian

This doesn't seem to with parity-util-mem because it configures global jemalloc so I removed it, thoughts?
Maybe, we do something inside parity-util-mem instead (but quite annoying to use here here with additive feature flags)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, right, it's outdated now, let's remove it and for memory profiling we would need to modify https://github.com/paritytech/parity-ethereum/blob/ff78f4318ab2c51063622ef32cd15f9ce62d95d3/Cargo.toml#L62

# hardcode version number 1.3.7 of parity to force an update
# in order to manually test that parity fall-over to the local version
# in case of invalid or deprecated command line arguments are entered
Expand Down
18 changes: 2 additions & 16 deletions ethcore/verification/benches/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,34 +122,20 @@ fn block_verification(c: &mut Criterion) {
let preverified = verification::verify_block_unordered(block, &ethash, true).expect(PROOF);
let parent = Unverified::from_rlp(rlp_8481475.clone()).expect(PROOF);

// "partial" means we skip uncle and tx verification
c.bench_function("verify_block_family (partial)", |b| {
b.iter(|| {
if let Err(e) = verification::verify_block_family::<TestBlockChainClient>(
&preverified.header,
&parent.header,
&ethash,
None
) {
panic!("verify_block_family (partial) ERROR: {:?}", e);
}
});
});

let mut block_provider = TestBlockChain::new();
block_provider.insert(rlp_8481476.clone()); // block to verify
block_provider.insert(rlp_8481475.clone()); // parent
block_provider.insert(rlp_8481474.clone()); // uncle's parent

let client = TestBlockChainClient::default();
c.bench_function("verify_block_family (full)", |b| {
c.bench_function("verify_block_family", |b| {
b.iter(|| {
let full = FullFamilyParams { block: &preverified, block_provider: &block_provider, client: &client };
if let Err(e) = verification::verify_block_family::<TestBlockChainClient>(
&preverified.header,
&parent.header,
&ethash,
Some(full),
full,
) {
panic!("verify_block_family (full) ERROR: {:?}", e)
}
Expand Down
7 changes: 0 additions & 7 deletions parity/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,11 @@ use configuration::{Cmd, Execute};
use deprecated::find_deprecated;
use hash::keccak_buffer;

#[cfg(feature = "memory_profiling")]
use std::alloc::System;

pub use self::configuration::Configuration;
pub use self::run::RunningClient;
pub use parity_rpc::PubSubSession;
pub use ethcore_logger::{Config as LoggerConfig, setup_log, RotatingLogger};

#[cfg(feature = "memory_profiling")]
#[global_allocator]
static A: System = System;

fn print_hash_of(maybe_file: Option<String>) -> Result<String, String> {
if let Some(file) = maybe_file {
let mut f = BufReader::new(File::open(&file).map_err(|_| "Unable to open file".to_owned())?);
Expand Down