mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Reduce temp allocations in network metrics (#1895)
## Issue Addressed Using `heaptrack` I could see that ~75% of Lighthouse temporary allocations are caused by temporary string allocations here. ## Proposed Changes Reduces temporary `String` allocations when updating metrics in the `network` crate. The solution isn't perfect since we rebuild our caches with each call, but it's a significant improvement. ## Additional Info NA
This commit is contained in:
@@ -75,3 +75,9 @@ impl Into<u64> for SubnetId {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<u64> for &SubnetId {
|
||||
fn into(self) -> u64 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user