Skip to content

Commit dfba134

Browse files
Pre-lookup indices
1 parent f469ef7 commit dfba134

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

database/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ impl Index {
671671
.keys()
672672
.filter(move |path| path.0 == krate && path.1 == profile && path.2 == cache)
673673
.map(|path| path.3)
674+
.filter(|q| !q.as_str().starts_with("codegen passes ["))
674675
}
675676
}
676677

site/src/selector.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,17 +665,27 @@ impl SelfProfile {
665665
.collect::<Vec<_>>();
666666
for cid in cids.iter() {
667667
let mut queries = Vec::new();
668+
log::trace!("Fetching {} self-profile-query series", labels.len());
669+
let conn = tx.conn();
670+
let cid_id = if let Some(c) = cid.lookup(&idx) {
671+
c
672+
} else {
673+
res.push(None);
674+
continue;
675+
};
668676
for label in labels.iter() {
669677
let query = crate::db::DbLabel::SelfProfileQuery {
670678
krate,
671679
profile,
672680
cache,
673681
query: *label,
674682
};
675-
if let Some(qd) = idx
676-
.get::<crate::db::QueryDatum>(tx.conn(), &query, cid)
677-
.await
678-
{
683+
let qid = if let Some(qid) = query.lookup(&idx) {
684+
qid
685+
} else {
686+
continue;
687+
};
688+
if let Some(qd) = conn.get_self_profile_query(qid, cid_id).await {
679689
queries.push(QueryData {
680690
label: *label,
681691
self_time: qd.self_time.as_nanos().try_into().unwrap(),

0 commit comments

Comments
 (0)