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

add feature 'enable_db_speed_record' #12

Conversation

xudaquan2003
Copy link

add feature 'enable_db_speed_record'

"reth-provider/enable_opcode_metrics",
"reth-stages/enable_db_speed_record",
"open_performance_dashboard",
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does enable_db_speed_record rely on other features?

#[cfg(feature = "enable_db_speed_record")]
impl Log {
/// Calculate size of the [Log].
#[cfg(feature = "enable_db_speed_record")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only one #[cfg(feature = "enable_db_speed_record")] is needed here

@@ -163,7 +193,7 @@ impl Future for MetricsListener {
loop {
let Some(event) = ready!(this.events_rx.poll_recv(cx)) else {
// Channel has closed
return Poll::Ready(())
return Poll::Ready(());
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should format the code.

db_speed_record.write_to_db_size = u64::try_from(state.size()).unwrap();
}
#[cfg(feature = "enable_db_speed_record")]
let mut write_to_db_time = revm_utils::time::TimeRecorder::now();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use mininstant get time.

if !(max_block - start_block > self.external_clean_threshold ||
provider.tx_ref().entries::<tables::AccountsTrie>()?.is_zero())
if !(max_block - start_block > self.external_clean_threshold
|| provider.tx_ref().entries::<tables::AccountsTrie>()?.is_zero())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Format the code.

enable_db_speed_record = [
"revm-utils",
"reth-revm-primitives/enable_opcode_metrics",
Copy link
Collaborator

Choose a reason for hiding this comment

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

A should not rely on other features

fn header_by_number_with_db_info(&self, num: BlockNumber) -> Result<(Option<Header>, u64, u64)> {
let lock = self.headers.lock();
Ok((lock.values().find(|h| h.number == num).cloned(), 0, 0))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

#[cfg(feature = "enable_db_speed_record")] fn header_by_number_with_db_info(&self, num: BlockNumber) -> (Result<Option<Header>>, u64, u64) { (self.header(number), 0, 0) }

.fold(U256::ZERO, |td, h| td + h.difficulty);
Ok((Some(sum), 0, 0))
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

@xudaquan2003 xudaquan2003 force-pushed the xudq/debug/enable_db_speed_record branch from ad7ed9a to 4adc66c Compare October 24, 2023 08:59
@xudaquan2003 xudaquan2003 force-pushed the xudq/debug/enable_db_speed_record branch from 4adc66c to 126b3f2 Compare October 24, 2023 10:34
@@ -234,11 +266,42 @@ impl<EF: ExecutorFactory> ExecutionStage<EF> {
// Write remaining changes
trace!(target: "sync::stages::execution", accounts = state.accounts().len(), "Writing updated state to database");
let start = Instant::now();

#[cfg(feature = "enable_db_speed_record")]
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

delete

@anonymousGiga anonymousGiga merged commit e007b1a into andy/debug/performance-dashboard Oct 25, 2023
5 of 17 checks passed
@anonymousGiga anonymousGiga deleted the xudq/debug/enable_db_speed_record branch October 25, 2023 03:51
anonymousGiga added a commit that referenced this pull request Nov 9, 2023
update

update

update

update

add finish_after_execution_stage feature for reth node

update revm

update log for revm metric

some update for performance-dashboard

update for write_to_db log

Split the get_revm_metric_record function into two

add feature 'enable_execution_duration_record' (#6)

* add feature 'enable_execution_duration_record'

* set 'enable_execution_duration_record' feature for util mod

refactor: refactoring the code of get revm metric (#8)

Refactor: refactoring the code of get cachedb metric (#9)

add feature 'enable_tps_gas_record' (#7)

* add feature 'enable_tps_gas_record'

* format and rebase code

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

use minstant instead of TimeRecord (#10)

update for revm dependencies (#11)

Enable sload percentiles (#14)

support test oom th (#15)

add feature 'enable_db_speed_record' (#12)

* add feature 'enable_db_speed_record'

* Some minor refactoring

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

update revm dependencies for opcode gas metric (#16)

update revm dependencies

refactor opcode metric (#17)

close some log

update dependencies

update revm dependencies

refactor performance dashboard (#19)

* support performance dashboard
* delete obsolete code

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

add sload duration percentile print
xudaquan2003 pushed a commit that referenced this pull request Nov 10, 2023
update

update

update

update

add finish_after_execution_stage feature for reth node

update revm

update log for revm metric

some update for performance-dashboard

update for write_to_db log

Split the get_revm_metric_record function into two

add feature 'enable_execution_duration_record' (#6)

* add feature 'enable_execution_duration_record'

* set 'enable_execution_duration_record' feature for util mod

refactor: refactoring the code of get revm metric (#8)

Refactor: refactoring the code of get cachedb metric (#9)

add feature 'enable_tps_gas_record' (#7)

* add feature 'enable_tps_gas_record'

* format and rebase code

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

use minstant instead of TimeRecord (#10)

update for revm dependencies (#11)

Enable sload percentiles (#14)

support test oom th (#15)

add feature 'enable_db_speed_record' (#12)

* add feature 'enable_db_speed_record'

* Some minor refactoring

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

update revm dependencies for opcode gas metric (#16)

update revm dependencies

refactor opcode metric (#17)

close some log

update dependencies

update revm dependencies

refactor performance dashboard (#19)

* support performance dashboard
* delete obsolete code

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

add sload duration percentile print
xudaquan2003 pushed a commit that referenced this pull request Nov 10, 2023
update

update

update

update

add finish_after_execution_stage feature for reth node

update revm

update log for revm metric

some update for performance-dashboard

update for write_to_db log

Split the get_revm_metric_record function into two

add feature 'enable_execution_duration_record' (#6)

* add feature 'enable_execution_duration_record'

* set 'enable_execution_duration_record' feature for util mod

refactor: refactoring the code of get revm metric (#8)

Refactor: refactoring the code of get cachedb metric (#9)

add feature 'enable_tps_gas_record' (#7)

* add feature 'enable_tps_gas_record'

* format and rebase code

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

use minstant instead of TimeRecord (#10)

update for revm dependencies (#11)

Enable sload percentiles (#14)

support test oom th (#15)

add feature 'enable_db_speed_record' (#12)

* add feature 'enable_db_speed_record'

* Some minor refactoring

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

update revm dependencies for opcode gas metric (#16)

update revm dependencies

refactor opcode metric (#17)

close some log

update dependencies

update revm dependencies

refactor performance dashboard (#19)

* support performance dashboard
* delete obsolete code

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

add sload duration percentile print
xudaquan2003 pushed a commit that referenced this pull request Nov 14, 2023
update

update

update

update

add finish_after_execution_stage feature for reth node

update revm

update log for revm metric

some update for performance-dashboard

update for write_to_db log

Split the get_revm_metric_record function into two

add feature 'enable_execution_duration_record' (#6)

* add feature 'enable_execution_duration_record'

* set 'enable_execution_duration_record' feature for util mod

refactor: refactoring the code of get revm metric (#8)

Refactor: refactoring the code of get cachedb metric (#9)

add feature 'enable_tps_gas_record' (#7)

* add feature 'enable_tps_gas_record'

* format and rebase code

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

use minstant instead of TimeRecord (#10)

update for revm dependencies (#11)

Enable sload percentiles (#14)

support test oom th (#15)

add feature 'enable_db_speed_record' (#12)

* add feature 'enable_db_speed_record'

* Some minor refactoring

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

update revm dependencies for opcode gas metric (#16)

update revm dependencies

refactor opcode metric (#17)

close some log

update dependencies

update revm dependencies

refactor performance dashboard (#19)

* support performance dashboard
* delete obsolete code

---------

Co-authored-by: anonymousGiga <cryptonymGong@gmail.com>

add sload duration percentile print

modify cargo default config

add enable_opcode_metrics feature in EVMProcessor

fix bug of caculate total_duration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants