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

String operations are slowing down collision flag assignment #65

Open
twaritwaikar opened this issue Nov 13, 2018 · 1 comment
Open
Labels
enhancement New feature or request good first issue Good for newcomers subject: Awerere Related to the physics engine

Comments

@twaritwaikar
Copy link
Member

accum = accum + ((((*this)[i] == '1') ? 1 : 0) * (((other[i] == '1') ? 1 : 0)));

The code above is mapping all "0" : string and "1" : string characters in the string to 0 : int and 1 : int. This is a costly operation and probably can be solved by switching to a different type of data container. E.g. Bitset or dynamic bitset, or boolean array

@twaritwaikar twaritwaikar added enhancement New feature or request good first issue Good for newcomers subject: Awerere Related to the physics engine labels Nov 13, 2018
@twaritwaikar
Copy link
Member Author

This was changed to use an array of integers. But a further improvement will be beneficial, by using a bitfield instead of an array of integers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers subject: Awerere Related to the physics engine
Projects
None yet
Development

No branches or pull requests

1 participant