I want to refer to the second week of Monero - this was the time I first read about it. I then tried to compile an optimized version of the miner and to share it with the community and I devoted a lot of time to do it. Back then my core i7 laptop hash rate was 6 H/s and now it's 107 H/s (just imagine what Bytecoin devs are trying to achieve with their purposely obfuscated and slow mining code despite of their 80% premine before that). NoodleDoodle managed to do the first 2x and then x4 optimizations up to 22+ H/s on my core i7 (that's what I was trying to do and I was just going to without having a lot of experience with different C compilers). This was the time when Monero become the main CryptoNote coin - most probably forever (or probably not). Back then I was happy to solo mine my first 80+ XMR with 6 H/s, then 10 H/s and then 20+ H/s - my first 2 weeks of Monero mining (if you want to be sure it's not premined read this: http://www.devtome.com/doku.php?id=a_massive_investigation_of_instamines_and_fastmines_for_the_top_alt_coins#monero and also you could read there about some shitcoins, which a lot of people are trying to defend in this thread). I bought some more (I made it to 450+) mainly from the OTC and mainly on the top price (0.00175 back then). Few days after I panicked and I dumped them all (I mean all) on the lowest price of 0.0008 (lol) - this was the day before it was listed on poloniex (and the day before I first heard of poloniex). Monero is also my first altcoin (lol). Back then I was never going to buy more of it on higher price if I didn't get the support of the community (Smooth pity me and sent me a lot (to my standard) and 2 more people sent me about 2 XMR). After that I bought again and I was riding the waves - I made some more and sometimes I dumped low (buy high, sell low they say - yeah:) - yesterday again I dumped about half of mine XMR for good (self irony).
And now to the essence (off topic) I started this post - it's not about XMR. Back then (in the third week of Monero) I argued about the difference 'if(expression)' could make compared to 'if(!expression)' in C compiled with mingw. I just found the C code I wrote many years ago and I was talking about. This is just the 30% final adjustment I achieved for the client after I already made it 90x faster for him and he cheated and he never paid me my 100$ we agreed on (should we have him in Monero?). Here is the code*:
*Those 'sums' are made on hundreds of thousands binary files provided by this client and I don't think it could be used in any meaningful way except on his data.
#include
#include
SEXP Sum(SEXP xNumVect, SEXP nCount, SEXP Nint)
{
int i, j, n, n1, N, N2;
double sum;
double *pNUM, *pResult;
SEXP result;
PROTECT(xNumVect = AS_NUMERIC(xNumVect));
N = INTEGER_VALUE(Nint);
n = INTEGER_VALUE(nCount);
PROTECT(result = NEW_NUMERIC(n));
pResult = NUMERIC_POINTER(result);
pNUM = NUMERIC_POINTER(xNumVect);
N2 = N - 2;
n1 = n - 1;
for(i = n1; i > N2; i--)
{
sum = 0;
for(j = 0; j < N; j++)
sum += pNUM[i - j];
pResult[i] = sum;
}
for(i = N2; i > -1; i--)
pResult[i] = R_NaN;
UNPROTECT(2);
return result;
}
SEXP Max(SEXP xNumVect, SEXP nCount, SEXP Nint)
{
int i, j, n, n1, N, N2;
double max;
double *pNUM, *pResult;
SEXP result;
PROTECT(xNumVect = AS_NUMERIC(xNumVect));
N = INTEGER_VALUE(Nint);
n = INTEGER_VALUE(nCount);
PROTECT(result = NEW_NUMERIC(n));
pResult = NUMERIC_POINTER(result);
pNUM = NUMERIC_POINTER(xNumVect);
N2 = N - 2;
n1 = n - 1;
for(i = n1; i > N2; i--)
{
max = R_NegInf;
for(j = 0; j < N; j++)
if(pNUM[i - j] == R_NaN)
if(pNUM[i - j] > max)
max = pNUM[i - j];
if(max == R_NegInf)
pResult[i] = R_NaN;
else
pResult[i] = max;
}
for(i = N2; i > -1; i--)
pResult[i] = R_NaN;
UNPROTECT(2);
return result;
}
SEXP Min(SEXP xNumVect, SEXP nCount, SEXP Nint)
{
int i, j, n, n1, N, N2;
double min;
double *pNUM, *pResult;
SEXP result;
PROTECT(xNumVect = AS_NUMERIC(xNumVect));
N = INTEGER_VALUE(Nint);
n = INTEGER_VALUE(nCount);
PROTECT(result = NEW_NUMERIC(n));
pResult = NUMERIC_POINTER(result);
pNUM = NUMERIC_POINTER(xNumVect);
N2 = N - 2;
n1 = n - 1;
for(i = n1; i > N2; i--)
{
min = R_PosInf;
for(j = 0; j < N; j++)
if(pNUM[i - j] == R_NaN)
if(pNUM[i - j] < min)
min = pNUM[i - j];
if(min == R_NegInf)
pResult[i] = R_NaN;
else
pResult[i] = min;
}
for(i = N2; i > -1; i--)
pResult[i] = R_NaN;
UNPROTECT(2);
return result;
}