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

Optimize subset generation. #18

Merged
merged 1 commit into from
Jan 21, 2022
Merged

Conversation

nstdio
Copy link
Contributor

@nstdio nstdio commented Jan 20, 2022

This PR provides significant performance boost for subset generation. Firstly, when assembling a next subset, namely instead of
looping over original input and checking a subset state in the bit vector now we
are loop directly on bit vector. The second one is that we don't unconditionally clear content of internal list, but overwrite old elements and clear leftovers afterwards.

        Input Size          Time          Cleared
before          30      4m 33sec      16106127330
after           30      2m 22sec        536870882

@nstdio nstdio changed the title Optimize SimpleSubSetIterator. Optimize subset generation. Jan 20, 2022
@coveralls
Copy link

coveralls commented Jan 20, 2022

Coverage Status

Coverage increased (+0.005%) to 99.746% when pulling 5702661 on nstdio:optimize-subset into 67c8a2f on dpaukov:master.

This commit provides significant performance boost for subset generation.
Firstly, when assembling a next subset, namely instead of
looping over original input and checking a subset state in the bit vector now we
are loop directly on bit vector.
The second one is that we don't unconditionally clear content of internal list, but
overwrite old elements and clear leftovers afterwards.
@dpaukov dpaukov merged commit 77324ea into dpaukov:master Jan 21, 2022
@dpaukov
Copy link
Owner

dpaukov commented Jan 21, 2022

Thank you for improving the performance of the subset iterator!

@nstdio nstdio deleted the optimize-subset branch January 21, 2022 11:47
@nstdio
Copy link
Contributor Author

nstdio commented Jan 21, 2022

Can we have a new patch version to try it out?

@dpaukov
Copy link
Owner

dpaukov commented Jan 30, 2022

Yes, the change is available in version 3.3.3.

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

3 participants