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

Speed up information retrieval #1098

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Daraan
Copy link
Contributor

@Daraan Daraan commented Jul 8, 2024

Where has this been tested?

  • Platform(s): Ubuntu 22.04
  • Python version(s): Python 3.7 and 3.10
  • CARLA version: 0.9.15

When using CarlaDataProvider.get_velocity/transform/location(actor) the lookup function loops over all dict keys and compares the actor id of each key against the argument's id. Comparing all ids is necessary, as different python instances of the same actor have different hashes, but inefficient if the argument is a present key.

This PR adds a best-case lookup before and checks if the actor a present key before it falls back to the slower loop over all actors.


This change is Reviewable

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.

None yet

1 participant