News for hackers. Stuff that matters.
Re:Software optimization resources for C++, assembly, Window... by a1369209993 on Saturday March 07, 2020 @03:08PM (#22513700)
> [...] what N must count. Traditionally, it counts comparisons, swaps, or other algorithmic events.

Er, N is counting the input elements (eg number of nodes in a graph, array length, etc), O() is what counts algorithmic or microarchitectural events.

> Similarly, "if (c) a -= b;" may become "a -= (-c & b);".

Reminds me of speeding up a ECC loop by almost two orders of magnitude with (basically):

  - if(i&(1<<k)) p ^= parity(x[i])<<k;
  + p32[k] ^= x[i] & -(ii&1); ii>>=1;
Re:Software optimization resources for C++, assembly, Window... by einpoklum on Saturday March 07, 2020 @04:08PM (#22514068)
GP mis-spoke, s/he meant "O(N) of what?" rather than "N of what?"
Re:Software optimization resources for C++, assembly, Window... by ncmncm on Saturday March 07, 2020 @04:08PM (#22514072)
Errr, right, N counts input, N^2 or whatever should count stalls. I should learn not to post from on the train.