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

nimi-python APIs inefficiently allocate Python arrays #1998

Closed
ni-jfitzger opened this issue Aug 16, 2023 · 0 comments · Fixed by #1999
Closed

nimi-python APIs inefficiently allocate Python arrays #1998

ni-jfitzger opened this issue Aug 16, 2023 · 0 comments · Fixed by #1999

Comments

@ni-jfitzger
Copy link
Collaborator

ni-jfitzger commented Aug 16, 2023

Description of issue

Our code is using a pattern like the following:
waveform_array_array = array.array("d", [0] * waveform_array_size)

While discussing #1997 , we discovered that it's much more efficent to allocate the array as follows (especially for large arrays):
waveform_array_array = array.array("d", [0]) * waveform_array_size

We should update all array allocations in the repo to follow this pattern. This affects multiple APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant