1.15.7
github-actions
released this
09 May 04:44
·
2712 commits
to master
since this release
Description
Abstract
Replace non-efficient implementation in EntityBase::setOtherStatus
function
Background
scenario_simulator_v2 was too slow, so we have to speed up for supporting a lot of entities.
In previous version, EntityBase::setOtherStatus
function was this.
void EntityBase::setOtherStatus(
const std::unordered_map<std::string, CanonicalizedEntityStatus> & status)
{
other_status_.clear(); // clear previous status
for (const auto & [other_name, other_status] : status) {
if (other_name != name) {
other_status_.emplace(other_name, other_status); // emplace status if the status comes from another entity.
}
}
}
It was not efficient.
Details
So, I replace it as
void EntityBase::setOtherStatus(
const std::unordered_map<std::string, CanonicalizedEntityStatus> & status) {
other_status_ = status;
other_status_.erase(name);
}
This PR is depends on #1237 and #1238
References
performance
before
This process took up 2.2% of the total processing time.
after
This process now takes 1.5% of the total processing time.
Destructive Changes
N/A
Known Limitations
N/A