Skip to content

Commit 80a6f8b

Browse files
Sujay JayakarConvex, Inc.
authored andcommitted
Remove potentially expensive heap stats computation (#31074)
GitOrigin-RevId: 8974d55175d4d0896b5b6057371975b470630016
1 parent 6768818 commit 80a6f8b

File tree

5 files changed

+0
-51
lines changed

5 files changed

+0
-51
lines changed

crates/application/src/application_function_runner/mod.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ use isolate::{
117117
HttpActionOutcome,
118118
IsolateClient,
119119
IsolateConfig,
120-
IsolateHeapStats,
121120
JsonPackedValue,
122121
UdfOutcome,
123122
ValidatedPathAndArgs,
@@ -187,7 +186,6 @@ use usage_tracking::{
187186
FunctionUsageTracker,
188187
};
189188
use value::{
190-
heap_size::HeapSize,
191189
id_v6::DeveloperDocumentId,
192190
identifier::Identifier,
193191
TableNamespace,
@@ -587,12 +585,6 @@ pub struct ApplicationFunctionRunner<RT: Runtime> {
587585
fetch_client: Arc<dyn FetchClient>,
588586
}
589587

590-
impl<RT: Runtime> HeapSize for ApplicationFunctionRunner<RT> {
591-
fn heap_size(&self) -> usize {
592-
self.cache_manager.heap_size()
593-
}
594-
}
595-
596588
impl<RT: Runtime> ApplicationFunctionRunner<RT> {
597589
pub fn new(
598590
instance_name: String,
@@ -697,14 +689,6 @@ impl<RT: Runtime> ApplicationFunctionRunner<RT> {
697689
Ok(())
698690
}
699691

700-
pub fn database_heap_size(&self) -> IsolateHeapStats {
701-
self.analyze_isolate.aggregate_heap_stats()
702-
}
703-
704-
pub fn http_actions_heap_size(&self) -> IsolateHeapStats {
705-
self.http_actions.aggregate_heap_stats()
706-
}
707-
708692
// Only used for running queries from REPLs.
709693
pub async fn run_query_without_caching(
710694
&self,

crates/application/src/cache/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ pub struct CacheManager<RT: Runtime> {
103103
cache: Cache,
104104
}
105105

106-
impl<RT: Runtime> HeapSize for CacheManager<RT> {
107-
fn heap_size(&self) -> usize {
108-
self.cache.heap_size()
109-
}
110-
}
111-
112106
#[derive(Clone, Eq, PartialEq, Hash)]
113107
pub struct CacheKey {
114108
path: PublicFunctionPath,
@@ -716,12 +710,6 @@ impl Cache {
716710
}
717711
}
718712

719-
impl HeapSize for Cache {
720-
fn heap_size(&self) -> usize {
721-
self.inner.lock().size
722-
}
723-
}
724-
725713
impl Inner {
726714
// Remove only a `CacheEntry::Ready` from the cache, predicated on its
727715
// `executor_id` matching.

crates/application/src/function_log.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,6 @@ pub struct FunctionExecutionLog<RT: Runtime> {
527527
rt: RT,
528528
}
529529

530-
impl<RT: Runtime> HeapSize for FunctionExecutionLog<RT> {
531-
fn heap_size(&self) -> usize {
532-
self.inner.lock().heap_size()
533-
}
534-
}
535-
536530
impl<RT: Runtime> FunctionExecutionLog<RT> {
537531
pub fn new(rt: RT, usage_tracking: UsageCounter, log_manager: Arc<dyn LogSender>) -> Self {
538532
let inner = Inner {
@@ -1228,12 +1222,6 @@ struct Inner<RT: Runtime> {
12281222
metrics: Metrics,
12291223
}
12301224

1231-
impl<RT: Runtime> HeapSize for Inner<RT> {
1232-
fn heap_size(&self) -> usize {
1233-
self.log.heap_size() + self.log_waiters.heap_size()
1234-
}
1235-
}
1236-
12371225
impl<RT: Runtime> Inner<RT> {
12381226
fn log_execution(
12391227
&mut self,

crates/database/src/database.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ use usage_tracking::{
137137
UsageCounter,
138138
};
139139
use value::{
140-
heap_size::HeapSize,
141140
id_v6::DeveloperDocumentId,
142141
Size,
143142
TableNamespace,
@@ -2018,10 +2017,6 @@ impl<RT: Runtime> Database<RT> {
20182017
self.usage_counter.clone()
20192018
}
20202019

2021-
pub fn write_log_size(&self) -> usize {
2022-
self.log.heap_size()
2023-
}
2024-
20252020
pub fn search_storage(&self) -> Arc<dyn Storage> {
20262021
self.search_storage
20272022
.get()

crates/database/src/write_log.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,6 @@ impl LogReader {
360360
}
361361
}
362362

363-
impl HeapSize for LogReader {
364-
fn heap_size(&self) -> usize {
365-
self.inner.read().heap_size()
366-
}
367-
}
368-
369363
/// LogWriter can append to the log.
370364
pub struct LogWriter {
371365
inner: Arc<RwLock<WriteLog>>,

0 commit comments

Comments
 (0)