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

performance: probably unnecessary array copies in _compute_all method from EKF class #105

Open
HicaroD opened this issue Dec 8, 2023 · 1 comment

Comments

@HicaroD
Copy link

HicaroD commented Dec 8, 2023

Those copies can be quite inneficient and it looks useless:

ahrs/ahrs/filters/ekf.py

Lines 1107 to 1108 in 761ff0e

self.gyr = np.copy(self.gyr)
self.acc = np.copy(self.acc)

Same for magnetometer here:

self.mag = np.copy(self.mag)

@HicaroD HicaroD changed the title probably unnecessary array copies in _compute_all method from EKF class performance: probably unnecessary array copies in _compute_all method from EKF class Dec 8, 2023
@HicaroD
Copy link
Author

HicaroD commented Dec 12, 2023

image

I've used Scalene to profile my code which uses ahrs in order to filter sensor data, and I noticed in the left side, more especifically in the yellow column, that I'm doing 13 MB/s of copies in the line where I instantiate EKF.

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

No branches or pull requests

1 participant