Bitcoin Forum
April 26, 2024, 05:15:08 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 [64] 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 ... 197 »
  Print  
Author Topic: [XPM] [ANN] Primecoin Release - First Scientific Computing Cryptocurrency  (Read 687907 times)
Impaler
Sr. Member
****
Offline Offline

Activity: 826
Merit: 250

CryptoTalk.Org - Get Paid for every Post!


View Profile
July 10, 2013, 09:22:36 PM
 #1261

malloc should be minimized by using a pool of reusable arrays, expand the pool as needed but never delete them or create them unessarily, this will be a huge improvement.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
nullbitspectre1848
Full Member
***
Offline Offline

Activity: 141
Merit: 100



View Profile
July 10, 2013, 09:27:14 PM
 #1262

I'm starting to get a little cheesed off.  Where the heck is the dev on this one?  Any chance of getting an optimized client so (regular) people can actually use this?

vinne81
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
July 10, 2013, 09:27:29 PM
 #1263

I'm starting to get a little cheesed off.  Where the heck is the dev on this one?  Any chance of getting an optimized client so (regular) people can actually use this?

+1
eule
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


View Profile
July 10, 2013, 09:28:59 PM
 #1264

here: https://bitcointalk.org/index.php?topic=253662.0

mustyoshi
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile
July 10, 2013, 09:29:12 PM
 #1265

I'm starting to get a little cheesed off.  Where the heck is the dev on this one?  Any chance of getting an optimized client so (regular) people can actually use this?

+1

It wasn't that hard to optimize it by hand.

Give C++ a try. It'll do you a lot more good than just making a quick speculative buck in the long run.
Mike270
Full Member
***
Offline Offline

Activity: 158
Merit: 100


View Profile
July 10, 2013, 09:40:54 PM
 #1266

For the two for loop, i get that

[...]

i'm not sure of myself on this one
Should do, but comment out
if (nBiTwinSeq < nChainLength)
in the first for loop, as that was the idea of splitting the loop (don't need to check there as that loop only runs up to nChainLength).
And add
unsigned int nBiTwinSeq = 0;
before the first loop
Rest looks ok (testing something else right now so my code already looks different.... yeah I know, no versioning, but hey... I'm doing this for fun :-) )
nmersulypnem
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
July 10, 2013, 09:43:21 PM
 #1267

For the two for loop, i get that

[...]

i'm not sure of myself on this one
Should do, but comment out
if (nBiTwinSeq < nChainLength)
in the first for loop, as that was the idea of splitting the loop (don't need to check there as that loop only runs up to nChainLength).
And add
unsigned int nBiTwinSeq = 0;
before the first loop
Rest looks ok (testing something else right now so my code already looks different.... yeah I know, no versioning, but hey... I'm doing this for fun :-) )



compile error.  Where am I noobing it...?


Code:

unsigned int nBiTwinSeq = 0;

for (; nBiTwinSeq < * nChainLength; nBiTwinSeq++)
{

....

Code:
prime.cpp: In member function 'bool CSieveOfEratosthenes::Weave()':
prime.cpp:532:27: error: invalid type argument of unary '*' (have 'unsigned int')


??  EDIT- never mind.  Someone virtual punch me in the face....
LazyOtto
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
July 10, 2013, 09:46:11 PM
 #1268

compile error.  Where am I noobing it...?

Code:

unsigned int nBiTwinSeq = 0;

for (; nBiTwinSeq < * nChainLength; nBiTwinSeq++)
{

....

Code:
prime.cpp: In member function 'bool CSieveOfEratosthenes::Weave()':
prime.cpp:532:27: error: invalid type argument of unary '*' (have 'unsigned int')


??
What do you think that asterisk is doing?

-- edit
I assume that "never mind" means you saw it after taking a short break.   Smiley
Mike270
Full Member
***
Offline Offline

Activity: 158
Merit: 100


View Profile
July 10, 2013, 09:47:41 PM
 #1269

What do you think that asterisk is doing?
Looking for Obelisk? :-)
LazyOtto
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
July 10, 2013, 09:49:44 PM
 #1270

What do you think that asterisk is doing?
Looking for Obelisk? :-)
My guess is that it was the avatar of an imp which just strolled in to have some fun.
vingaard
Legendary
*
Offline Offline

Activity: 1246
Merit: 1011



View Profile
July 10, 2013, 09:51:15 PM
 #1271

One question...

I'm running the same wallet in two computers (in different places) and I just find a block... how can I know which computer has mined this block... I mean... the wallet I can see at the moment mark the block as mined, but I figured that the other wallet (in other place) will mark the same... so... How can I know which computer have found the block?

LazyOtto
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
July 10, 2013, 09:51:43 PM
 #1272

debug.log
Mike270
Full Member
***
Offline Offline

Activity: 158
Merit: 100


View Profile
July 10, 2013, 09:59:08 PM
 #1273

One question...

I'm running the same wallet in two computers (in different places) and I just find a block... how can I know which computer has mined this block... I mean... the wallet I can see at the moment mark the block as mined, but I figured that the other wallet (in other place) will mark the same... so... How can I know which computer have found the block?


Look out for
proof-of-work found
in debug.log
drummerjdb666
Full Member
***
Offline Offline

Activity: 244
Merit: 101



View Profile
July 10, 2013, 09:59:49 PM
 #1274

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

Code:
        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!!!  Smiley      to the greedy people!?  killurselves

sry 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!
gatra
Hero Member
*****
Offline Offline

Activity: 583
Merit: 505


CTO @ Flixxo, Riecoin dev


View Profile WWW
July 10, 2013, 10:04:37 PM
 #1275

Hi gatra,

with those few blocks/day and primes/s being quite imprecise...
I left optimizations in when they didn't appear to cause an immediately visible (~10min) deterioration in primes/s.


Hi

I didn't try it for primecoin, but for other coin I used this: https://github.com/freewil/bitcoin-testnet-box
It's just a script that allows you to run 2 instances against each other, so it works like a small network of 2 nodes. If you run the optimized against the standard wallet and have them mine for some time, the faster one should have mined more blocks.

Also, using ints for the bool arrays adds only a couple of fast instructions: for example instead of doing vfCompositeBiTwin[nVariableMultiplier] = true;
you would do
vfCompositeBiTwin[nVariableMultiplier >> 5] |= 1 << (nVariableMultiplier & 0x1f )

for testing it's    if( vfCompositeBiTwin[nVariableMultiplier >> 5] & (1 << (nVariableMultiplier & 0x1f )))


           ▄▄▄██████████▄▄▄
       ▄▄██
██████████████████▄▄
     ▄█
█████▀████████████▀██████▄
   ▄█
█████████████████████████████▄
  ▄█
█████████▄█▀▀██████████████████▄
 ▄█
███████████▀██████▄▄█████▄███████▄
▄█
██████████▀██▄▄▄▄██▀▀▀▀▀███████████▄
█████████████▀▀██▀████████▀▀████████
█████████████▄█▀████████████████████
████████▀▀▀▀██▀▀▀▀██████████████████
▀█
██████▀▀▀▀██▀▀▀▀███████████████████▀
 ▀█
███████▄████▄▄███████████████████▀
  ▀█
███████████████████████████████▀
   ▀█
█████████████████████████████▀
     ▀█
█████▄████████████▄██████▀
       ▀▀██
██████████████████▀▀
           ▀▀▀██████████▀▀▀
riecoin       ▄▄█████████▄▄
    ▄██▀▀         ▀▀██▄
  ▄██▀              ▀██▄
 ▄██     ██▄▄          ██▄
▄██      █████▄▄        ██▄
██       ████████▄▄      ██
██       ███████████▄    ██
██       ██████████▀     ██
▀██      ███████▀       ██▀
 ▀██     ████▀         ██▀
  ▀██▄   █▀          ▄██▀
    ▀██▄▄         ▄▄██▀
       ▀▀█████████▀▀
.flixxo   
nmersulypnem
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
July 10, 2013, 10:08:34 PM
 #1276


Has anyone successfully compiled on Windows with UPNP?  I notice my new optimized binary is much faster, but it seems so have a much worse network connection (and the binary is much smaller).
Mike270
Full Member
***
Offline Offline

Activity: 158
Merit: 100


View Profile
July 10, 2013, 10:28:07 PM
 #1277

Another update from Sunny King is upcoming - not only will it bail out after max. 3 secs, it will also bail out if a new block has arrived in the meantime.
-> https://bitcointalk.org/index.php?topic=253662.msg2702001#msg2702001

And if shinkicker's still awake he may provide a compiled windows client :-)
8bitPunk
Member
**
Offline Offline

Activity: 70
Merit: 10



View Profile
July 10, 2013, 10:30:31 PM
 #1278

Another update from Sunny King is upcoming - not only will it bail out after max. 3 secs, it will also bail out if a new block has arrived in the meantime.
-> https://bitcointalk.org/index.php?topic=253662.msg2702001#msg2702001

And if shinkicker's still awake he may provide a compiled windows client :-)

Awesome, thanks Mike270 & shinkicker ! Tips to you both Smiley

BTC 18bPunkuginRBm1Xz9mcgj8mWJnHDAW5Th | Ł LTCgXEdyBdoQ9WdF6JHi7Pa2EWtzbDjG76 | Ψ ATEBiTLkLpAYeW5hQknUfSvnb7Abbgegku
drummerjdb666
Full Member
***
Offline Offline

Activity: 244
Merit: 101



View Profile
July 10, 2013, 10:38:32 PM
 #1279

Another update from Sunny King is upcoming - not only will it bail out after max. 3 secs, it will also bail out if a new block has arrived in the meantime.
-> https://bitcointalk.org/index.php?topic=253662.msg2702001#msg2702001

And if shinkicker's still awake he may provide a compiled windows client :-)

LoL!  am I a shinkicker?   I like kicker of balls and shins together!!! 

did he release a linux update though.. that doesn't involve need to add code to it?
shinkicker
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
July 10, 2013, 10:43:59 PM
 #1280

And if shinkicker's still awake he may provide a compiled windows client :-)

Just about Smiley

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?
Pages: « 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 [64] 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 ... 197 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!