n4ru
|
 |
July 10, 2013, 10:53:26 PM |
|
Ok, so I'm probably hurting my income, but sharing some hints for optimizations: A quick'n'dirty profiling run showed that we spend very much time in memory allocations, so I am trying to eliminate some of them.
-did the headerhash mod outlined earlier
-did the time limit on Weave() from Sunny King
-removed some printf's , especially printf("MineProbablePrimeChain() : new sieve (%u/%u) ready in %uus\n", psieve->GetCandidateCount(), nMaxSieveSize, (unsigned int) (GetTimeMicros() - nStart)); from prime.cpp since it's the only call to the rather expensive GetCandidateCount
-after creating vPrimes array in prime.cpp, store vPrimes.size() in a static variably and replace all calls to it with the variable
-in prime.cpp, PrimeTableGetNextPrime and PrimeTableGetPreviousPrime: Use upper_bound/lower_bound instead of linear search: // Get next prime number of p bool PrimeTableGetNextPrime(unsigned int& p) { std::vector<unsigned int>::iterator foundelement=upper_bound(vPrimes.begin(), vPrimes.end(),p); if (foundelement!=vPrimes.end()){ p=*foundelement; return true; } return false; }
// Get previous prime number of p bool PrimeTableGetPreviousPrime(unsigned int& p) { std::vector<unsigned int>::iterator foundelement=lower_bound(vPrimes.begin(), vPrimes.end(),p); if (foundelement!=vPrimes.end()){ p=*--foundelement; return true; } return false; }
- in prime.cpp, CSieveOfEratosthenes::Weave() : Split the for loop into two for loops, one going up to nChainLength, the other one going up to 2*nChainLength Thus, you can safe the first first if+for clause in the first loop and leave away the if, and leave the if+for completely away in the second loop. Also, if (((nBiTwinSeq & 1u) == 0)) ... if (((nBiTwinSeq & 1u) == 1u))
can be substituted by
if (((nBiTwinSeq & 1u) == 0)) .... else .....
-prime.h: Removed nSieveSize and replaced all occurrences with nMaxSieveSize. Removed nSieveSize from the initializer as it's become obsolete.
-prime.h: Changed < std::vector<bool> vfCompositeCunningham1; < std::vector<bool> vfCompositeCunningham2; < std::vector<bool> vfCompositeBiTwin; --- > bool vfCompositeCunningham1[1000000]; > bool vfCompositeCunningham2[1000000]; > bool vfCompositeBiTwin[1000000]; Thus, we should save on quite a few mallocs.
-prime.h: Removed nSieveSize and replaced all occurrences with nMaxSieveSize. Removed nSieveSize from the initializer as it's become obsolete.
-prime.h: Changed < std::vector<bool> vfCompositeCunningham1; < std::vector<bool> vfCompositeCunningham2; < std::vector<bool> vfCompositeBiTwin; --- > bool vfCompositeCunningham1[1000000]; > bool vfCompositeCunningham2[1000000]; > bool vfCompositeBiTwin[1000000]; Thus, we should save on quite a few mallocs.
Don't forget to initialize the array by adding the following below in place of the other initialization for (int i = 0; i<1000000; ++i){ vfCompositeCunningham1[i] = false; vfCompositeCunningham2[i] = false; vfCompositeBiTwin[i] = false; } I think it'd be ideal to use a 2D array with the three composite values stored sequentially in memory as single bits each
Probably should be a std::bitset datatype too
+1 Or somebody could not be a greedy dick! And at least show the noob that wants to attempt to help out ur network with more miners which files to add all this too.. or code to replace this with.. any explanation to a non coder how to implement.. Or hopefully I have found a dev in this community that is willing to have a young grasshopper!!! to the greedy people!? killurselvessry to be an ass but some of you coders are shitting on my big smile i had when i woke up today! and to think the people I am talking about... I have randomly spoken very positive about in different place in the coin community! psh! The amount of entitlement in this thread is too damn high!
|
|
|
|
|
|
|
"In a nutshell, the network works like a distributed
timestamp server, stamping the first transaction to spend a coin. It
takes advantage of the nature of information being easy to spread but
hard to stifle." -- Satoshi
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
|
LazyOtto
|
 |
July 10, 2013, 10:53:38 PM |
|
[a rant]
Or maybe you could quit bitching about it? If you're not technically inclined, you can't be on the bleeding edge. I merely placed him on ignore. I have no patience for those who feel entitled to the fruits of others' labor.
|
|
|
|
Mike270
|
 |
July 10, 2013, 10:58:49 PM |
|
And if shinkicker's still awake he may provide a compiled windows client :-)
Just about  When Sunny commits his code to the repo, I will build another (if I am still awake). Or you could pastebin your file and we could try that? Is this prime or main.cpp? I'd feel better waiting for his official commit in case he still adopts it in some way (he knows the code better than me) since we have to assume that a larger group of people will download & use it. But if you're impatient :-) , I outlined it in https://bitcointalk.org/index.php?topic=253662.msg2701731#msg2701731 . It's prime.cpp. Kind regards Mike
|
|
|
|
Mike270
|
 |
July 10, 2013, 11:03:48 PM |
|
WAIT! There just was an update to the repository! He also did some more updates, like making some mining printf's configurable, it seems.
|
|
|
|
96redformula
|
 |
July 10, 2013, 11:06:19 PM |
|
Why is it that we finally get an updated binary and then we get even more changes immediately after ? 
|
|
|
|
Mike270
|
 |
July 10, 2013, 11:09:51 PM |
|
Why is it that we finally get an updated binary and then we get even more changes immediately after ?  Just happened to be that way.... neverhappy...
|
|
|
|
nmersulypnem
|
 |
July 10, 2013, 11:13:26 PM |
|
Is there a way to package Qt and MingGw in the windows binary? I hate to have to install these on every PC...
|
|
|
|
Hydroponica
Full Member
 
Offline
Activity: 182
Merit: 100
fml
|
 |
July 10, 2013, 11:14:20 PM |
|
Why is so much info about PrimeCoin hidden? Can't see network hash, can't see current difficulty...Unless I'm missing something 
|
|
|
|
Eli0t
|
 |
July 10, 2013, 11:15:38 PM |
|
getdifficulty
7.62721026
but yeah cant see network PPS
|
LTC: LKpJf3uk7KsHU73kxq8iFJrP1AAKN7Yni7 DGC: DKXGvEbj3Rwgrm2QQbRyNPDDZDYoq4Y44d XPM: AWV5AKfLFyoBaMjg9C77rGUBhuFxz5DGGL
|
|
|
eule
|
 |
July 10, 2013, 11:16:54 PM |
|
Primecoin: Add gensieveroundlimitms config parameter Can someone tell me what this mysterious new command might do? 
|
|
|
|
drummerjdb666
|
 |
July 10, 2013, 11:21:56 PM |
|
The amount of entitlement in this thread is too damn high!
Yup. And the bullshit like "I'm sure they banned EC2! Or it wouldn't be 'fair'!". Why is it that we finally get an updated binary and then we get even more changes immediately after ?  Stop being a nooby noob and learn to compile your software like real men do, instead of blindly accepting binaries from unknown users. i'm trying to learn.. but have random questions.. and am told i'm entitled because of it.. don't ever shoot me down for trying to learn something.. i'll do bad things to ur mom and her little dog too
|
|
|
|
poiuytr4
Newbie
Offline
Activity: 17
Merit: 0
|
 |
July 10, 2013, 11:22:45 PM |
|
Thanks SunnyKing. You have made crypto currencies a lot more interesting. Most of these posts are about how to optimise the client but the fundamentals are to do with prime numbers and number theory and hopefully the real benefit of your coin will be more interest in these areas. I like this stuff but I've already learnt more from looking at the ideas behind your currency. I am sure that there are real number theory experts that have a lot of expertise in generating and analysing primes who have probably haven't heard of prime coin yet. Instead of doing strange abstract pure mathematics for no reason  they could now do it to generate a strange virtual currency. I think that there will a whole generation of ways of improving and optimising your client and block generation speeds but I think this will be closer to mathematical research than speeding up hashing. One of the things I don't understand is why the verification techniques are not a more optimal method to generate the chains? I also am slightly concerned that the integral of the difficulty factor will not change very often and so the difficulty factor will be dependent on the remainder of the Fermat test which is not very well explained and apparently not linear. This might make the difficulty levels a bit wobbly but none of this will necessarily be a major problem. I'm looking forward to following the progress of prime coin. Good luck. 
|
|
|
|
dudeguy
Member

Offline
Activity: 182
Merit: 10
|
 |
July 10, 2013, 11:32:11 PM |
|
The amount of entitlement in this thread is too damn high!
Yup. And the bullshit like "I'm sure they banned EC2! Or it wouldn't be 'fair'!". Why is it that we finally get an updated binary and then we get even more changes immediately after ?  Stop being a nooby noob and learn to compile your software like real men do, instead of blindly accepting binaries from unknown users. i'm trying to learn.. but have random questions.. and am told i'm entitled because of it.. don't ever shoot me down for trying to learn something.. i'll do bad things to ur mom and her little dog too We're not shooting you down for trying to learn something. We're shooting you down because you aren't using Google to answer your questions and are therefore wasting our fucking time. You're also acting like a five year old. Somebody smart just put it very simply. I'm going to leave it at this and chose not not agree or disagree with the quote but be somewhere in between. "There's nothing to be proud of if you are stealing blocks. Sure love the free market and talk about it all day, but when it comes to committing crypto-suicide, short of a 51% attack, exploiting mining software for individual benefit is just about as effective as it comes."
|
|
|
|
nmersulypnem
|
 |
July 10, 2013, 11:33:57 PM |
|
Is anyone else getting an internal compile error on the new main.cpp?
|
|
|
|
drummerjdb666
|
 |
July 10, 2013, 11:35:20 PM |
|
I am using google.. I live inside of the matrix usually! although this post is where the majority of the info on this subject is.. I was trying to ask which of the files those edits need to be made to.. Even if I have to get all troll and turn into a 5yr old for a bit.. I will get my questions answered.. just maybe not publicly in this thread... I like when people throw gas on my fire's though! It makes me smile! Not hard to get most people all butt hurt.. which apparently happened a bit ago.. very amusing.. i respond like a dick style troll and move on! 
|
|
|
|
LazyOtto
|
 |
July 10, 2013, 11:38:11 PM |
|
Is anyone else getting an internal compile error on the new main.cpp?
I just did a "git pull" to update the code on local repository. Then it compiled OK. Did spit out a rather nasty sounding warning to the effect of "you really oughta put a semicolon here". But just a warning, not an error. I'm currently running it on OS X. -- edit - replaced "error" where I meant to say "warning"
|
|
|
|
LazyOtto
|
 |
July 10, 2013, 11:41:29 PM |
|
Is anyone else getting an internal compile error on the new main.cpp?
Did you mean the compiler itself generated an internal error on you? I remember the days when I used to use Visual Studio. 
|
|
|
|
Zalfrin
|
 |
July 10, 2013, 11:55:44 PM |
|
Here is my qt compiled on an i5 under windows 7 with the latest updates from Sunny. As the previous guy who posted a qt said, do your due diligence before using this... encrypt wallet, run thru virus scan, etc. https://www.dropbox.com/s/zz2m6sx84rd7rr8/release.zipIf you found this helpful and feel so inclined, you can send donations to ANYwjHw5iDq3FrN3z5JfMsPqZptgoD94pa for primecoin or 1NrbAL9G6Lc3DEYdrbzwCrrJMKxMXqkHB for bitcoin
|
|
|
|
Zalfrin
|
 |
July 11, 2013, 01:10:45 AM |
|
Doesn't work, needs libgcc DLL. [/quote] Sorry about that, I will recompile with static.
|
|
|
|
nmersulypnem
|
 |
July 11, 2013, 01:18:29 AM |
|
Doesn't work, needs libgcc DLL. Sorry about that, I will recompile with static. [/quote] Actually, I'm having that problem as well - how do you compile embedding the DLLs?
|
|
|
|
|