Skip to content

Commit

Permalink
Shuffle external mode: Micro-optimizations relying on our engine
Browse files Browse the repository at this point in the history
1. Variables are pre-initialized to 0.

2. Order of operations within an expression is specific.  Since this
external mode is bundled, we'll have opportunity to revise it along with
any compiler changes.  Meanwhile, it's valid for older versions as well,
and this dirty optimization provides a ~1% speedup.
  • Loading branch information
solardiz committed May 29, 2024
1 parent 2ecbae6 commit 3120e05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions run/john.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3978,7 +3978,7 @@ void init()
max_length = 10;

/* Prepare a 12-bit count leading zero table */
int i; i = -1;
int i; i = 0;
while (i++ < 12) {
int j; j = 0;
while (j < 0x1000)
Expand Down Expand Up @@ -4025,7 +4025,7 @@ void next()
k = id[i];
int mask; mask = prev_unseen;
while (k--)
mask &= mask - 1;
mask = mask & --mask; /* Would be UB in C /
/* Count how many total indices we skipped */
if ((j = clz[mask & 0xfff]) == 12) {
while ((k = clz[(mask >>= 12) & 0xfff]) == 12)
Expand Down

0 comments on commit 3120e05

Please sign in to comment.