Skip to content

Commit 4e10cfc

Browse files
committed
Report data structures size
1 parent e1a3029 commit 4e10cfc

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

danny/src/experiment.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use chrono::prelude::*;
33
use rusqlite::*;
44
use std::path::{Path, PathBuf};
55
use std::{collections::HashMap, time::Duration};
6-
use crate::sysmonitor::SystemUsage;
6+
use crate::sysmonitor::{DATASTRUCTURES_BYTES, SystemUsage};
77

88
pub struct Experiment {
99
db_path: PathBuf,
@@ -199,10 +199,12 @@ impl Experiment {
199199
speedup,
200200
201201
profile_frequency,
202-
dry_run
202+
dry_run,
203+
204+
datastructures_bytes
203205
)
204206
VALUES (
205-
?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23, ?24, ?25
207+
?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23, ?24, ?25, ?26
206208
)",
207209
params![
208210
env!("VERGEN_SHA_SHORT"),
@@ -230,7 +232,8 @@ impl Experiment {
230232
recall,
231233
speedup,
232234
self.config.profile.unwrap_or(0),
233-
self.config.dry_run
235+
self.config.dry_run,
236+
DATASTRUCTURES_BYTES.load(std::sync::atomic::Ordering::SeqCst) as i64
234237
],
235238
)
236239
.expect("error inserting into main table");
@@ -456,6 +459,11 @@ fn db_migrate(conn: &Connection) {
456459
conn.execute_batch(include_str!("migrations/v10.sql"))
457460
.expect("error applying version 10");
458461
}
462+
if version < 11 {
463+
info!("Applying migration v11");
464+
conn.execute_batch(include_str!("migrations/v11.sql"))
465+
.expect("error applying version 11");
466+
}
459467

460468
info!("Database migration completed!");
461469
}

danny/src/lsh/algorithms/local_lsh.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use serde::de::Deserialize;
1515
use std::clone::Clone;
1616
use std::collections::HashMap;
1717
use std::fmt::Debug;
18-
use std::mem::size_of;
1918
use std::sync::Arc;
2019
use std::time::Instant;
2120
use timely::communication::Allocator;
@@ -292,7 +291,7 @@ where
292291
vectors.entry(t.time().clone()).or_insert_with(HashMap::new);
293292
let data = data.replace(Vec::new());
294293
DATASTRUCTURES_BYTES
295-
.fetch_add(data.deep_size_of(), std::sync::atomic::Ordering::SeqCst);
294+
.fetch_add(dbg!(data.deep_size_of()), std::sync::atomic::Ordering::SeqCst);
296295
for (subproblem_key, marker, (k, (v, p, s))) in data {
297296
subproblems
298297
.entry(subproblem_key)

danny/src/migrations/v11.sql

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
BEGIN TRANSACTION;
2+
3+
ALTER TABLE result ADD COLUMN datastructures_bytes INTEGER;
4+
5+
PRAGMA user_version = 11;
6+
7+
END TRANSACTION;

0 commit comments

Comments
 (0)