Thank you to all who answered, thank you for your time.
OK, how many 0.1 seconds do you have to save, to recoup the effort so far expended on discussing "optimisation". |
It's not about getting it 10% faster, my goal as a beginnter is to learn something about C++, what tools do I have, what could be done with this kit. Learning by toying.
Thank you for this hint.
Works.
but I think a good thing to know is why you need to count the number of 1s in an array of bits of magnitude 10e8? And how often is this done (60 FPS)? |
Not very often, just once in a while. And I do need to count the 'on' bits to compare the result with existing programgs from others.
If this is something important to you, you may want to revisit the entire architecture of your solution |
No, it is not important for me, I just test, how I get along with C++, if I could imagine to do something useful with it. The question I ask in the subject of this thread is a kind of "revisit of the entire architecture".
What I do with this 1e8 bits and more in that bool vector? Counting primes, not even new ones, since long time well known primes. So for sure the result is colourless, it is only about the way to get it. And to get it fast. Of course I coud run this ready to use program from
https://primesieve.org/ but as said before, this is not my goal, it is a role model.
Edit: marked what answered my question.