-
Notifications
You must be signed in to change notification settings - Fork 95
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
Remove profiler #914
Remove profiler #914
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a few nits and questions.
@@ -52,7 +51,7 @@ fn test_load_contract_in_script() -> IoResult<(), MemoryStorageError> { | |||
context: &Context::Script { | |||
block_height: Default::default(), | |||
}, | |||
profiler: &mut Profiler::default(), | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
@@ -111,7 +108,7 @@ fn test_load_contract_in_call() -> IoResult<(), MemoryStorageError> { | |||
context: &Context::Call { | |||
block_height: Default::default(), | |||
}, | |||
profiler: &mut Profiler::default(), | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
@@ -134,17 +127,15 @@ fn test_code_root_contract_not_found() { | |||
memory: &mut memory, | |||
storage: &storage, | |||
gas_cost, | |||
profiler: &mut Default::default(), | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
@@ -184,17 +174,15 @@ fn test_code_root_contract_not_in_inputs() { | |||
memory: &mut memory, | |||
storage: &storage, | |||
gas_cost, | |||
profiler: &mut Default::default(), | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -143,7 +143,7 @@ fn test_mint( | |||
context: &context, | |||
receipts: &mut receipts, | |||
memory: &mut memory, | |||
profiler: &mut Profiler::default(), | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -213,7 +209,7 @@ struct TransferCtx<'vm, S, Tx> { | |||
context: &'vm Context, | |||
balances: &'vm mut RuntimeBalances, | |||
receipts: &'vm mut ReceiptsCtx, | |||
profiler: &'vm mut Profiler, | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -108,7 +108,7 @@ where | |||
context: self.context, | |||
balances: self.balances, | |||
panic_context: self.panic_context, | |||
profiler: self.profiler, | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -198,7 +198,7 @@ where | |||
context: self.context, | |||
balances: self.balances, | |||
panic_context: self.panic_context, | |||
profiler: self.profiler, | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub(crate) fn contract_id(&self) -> Option<ContractId> { | ||
self.frames.last().map(|frame| *frame.to()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was used only for debugger=)
pub current_contract: Option<ContractId>, | ||
pub cgas: RegMut<'vm, CGAS>, | ||
pub ggas: RegMut<'vm, GGAS>, | ||
pub is: Reg<'vm, IS>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are current_contract
and is
removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was used by profiler
pub(crate) fn contract_id(&self) -> Option<ContractId> { | ||
self.frames.last().map(|frame| *frame.to()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was used only for debugger=)
pub current_contract: Option<ContractId>, | ||
pub cgas: RegMut<'vm, CGAS>, | ||
pub ggas: RegMut<'vm, GGAS>, | ||
pub is: Reg<'vm, IS>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was used by profiler
Nobody uses the profiler. The profiler pollutes gas charging code. The profiler hurts performance. The superset of this functionality is already available with the debugger. After disussing with @xgreenx, we deemed that removing the profiler is the way to go.
This is a breaking change. I'm quite certain nobody is using this, though, and the replacement is already available.
Since this is supposed to improve benchmarks, we probably want to update gas costs. The effect should be quite even betweeen all opcodes though.
Checklist
Before requesting review