Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding cache for transfer_path #4213

Merged
merged 5 commits into from
Feb 13, 2024
Merged

Adding cache for transfer_path #4213

merged 5 commits into from
Feb 13, 2024

Conversation

azime
Copy link
Contributor

@azime azime commented Feb 8, 2024

Jira: NAV-2719

@azime azime requested review from kadhikari, xlqian and pbench February 8, 2024 13:43
def _get_access_points(self, stop_point_uri, access_point_filter=lambda x: x):
sub_request_id = "{}_transfer_start_{}".format(self._request_id, stop_point_uri)
stop_points = self._instance.georef.get_stop_points_from_uri(stop_point_uri, sub_request_id, depth=2)
def _get_access_points(self, pt_object, access_point_filter=lambda x: x):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be a more proper way to do it, you can create an abstract function in PtPlanner that returns access points, and the implementation should be "hidden" in the concrete class base on the type of PtPlanner,


def _do_access_point_transfer(self, section, prev_section_mode, next_section_mode):
access_points = self.get_underlying_access_points(section, prev_section_mode, next_section_mode)
return (
Copy link
Member

@xlqian xlqian Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just need to be cautious/aware of the huge amount of string that could be generated by this thus impacting the performance cache/redis, (it's not particularly worrying since Asgard has been doing so...) On top of that, serialize/deserialize could be time-consuming as well

Copy link

sonarqubecloud bot commented Feb 9, 2024

@xlqian xlqian merged commit dd2069f into dev Feb 13, 2024
9 checks passed
@xlqian xlqian deleted the transfer_path_cached branch February 13, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants