Skip to content

Speed up plan access #827

@k88hudson-cfa

Description

@k88hudson-cfa

Profiling large simulation sizes (1,000,000+) shows a decent amount of time spent in accessing plans:
Image

Given plans have sequential ids, perhaps we could speed things up by using a better data structure than a HashMap?

ixa/src/plan.rs

Lines 127 to 146 in d98a7f5

pub fn get_next_plan(&mut self) -> Option<Plan<T>> {
trace!("getting next plan");
loop {
// Pop from queue until we find a plan with data or queue is empty
match self.queue.pop() {
Some(entry) => {
// Skip plans that have been cancelled and thus have no data
if let Some(data) = self.data_map.remove(&entry.plan_id) {
return Some(Plan {
time: entry.time,
data,
});
}
}
None => {
return None;
}
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions