[GH-ISSUE #1199] 29% performance regression for --format=bcrypt #748

Closed
opened 2026-10-14 03:22:16 +07:00 by bsakaguchi · 39 comments
Owner

Originally created by @frank-dittrich on GitHub (Apr 11, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1199

Originally assigned to: @solardiz on GitHub.

On 64bit Linux:

fd@fdu:~/git/JtR/src$ git status |head -n 2
On branch bleeding-jumbo
Your branch is up-to-date with 'origin/bleeding-jumbo'.
fd@fdu:~/git/JtR/src$ make -s distclean ; ./configure > /dev/null && make -s -j 8 && cd ../run/ && ./john --test --format=bcrypt; cd ../src/
DES_std.c: In function 'DES_std_set_key':
DES_std.c:639:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
/usr/bin/ar: creating aes.a

Make process completed.
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (4xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw:    3888 c/s real, 967 c/s virtual

fd@fdu:~/git/JtR/src$ git checkout 88b1a10889405a9f33690795368d1faa21c1c59b
Note: checking out '88b1a10889405a9f33690795368d1faa21c1c59b'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 88b1a10... Revert "bcrypt / opencl: created a BF_common set of functions / data"
fd@fdu:~/git/JtR/src$ make -s distclean ; ./configure > /dev/null && make -s -j 8 && cd ../run/ && ./john --test --format=bcrypt; cd ../src/
DES_std.c: In function 'DES_std_set_key':
DES_std.c:639:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
/usr/bin/ar: creating aes.a

Make process completed.
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (4xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw:    5040 c/s real, 1253 c/s virtual

fd@fdu:~/git/JtR/src$ git checkout bbe3e324121a55d40d845b7eea94cd0963951d95
Previous HEAD position was 88b1a10... Revert "bcrypt / opencl: created a BF_common set of functions / data"
HEAD is now at bbe3e32... Merge branch 'master' into bleeding-jumbo
fd@fdu:~/git/JtR/src$ make -s distclean ; ./configure > /dev/null && make -s -j 8 && cd ../run/ && ./john --test --format=bcrypt; cd ../src/
DES_std.c: In function 'DES_std_set_key':
DES_std.c:639:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
/usr/bin/ar: creating aes.a

Make process completed.
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (4xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw:    3825 c/s real, 966 c/s virtual

So, for some reasons, merging Solar's core changes caused this performance regression on my hardware:

$ head -n 25 /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 60
model name  : Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
stepping    : 3
microcode   : 0x16
cpu MHz     : 800.390
cache size  : 6144 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 4
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm
bogomips    : 5986.37
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:
Originally created by @frank-dittrich on GitHub (Apr 11, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1199 Originally assigned to: @solardiz on GitHub. On 64bit Linux: ``` fd@fdu:~/git/JtR/src$ git status |head -n 2 On branch bleeding-jumbo Your branch is up-to-date with 'origin/bleeding-jumbo'. fd@fdu:~/git/JtR/src$ make -s distclean ; ./configure > /dev/null && make -s -j 8 && cd ../run/ && ./john --test --format=bcrypt; cd ../src/ DES_std.c: In function 'DES_std_set_key': DES_std.c:639:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ /usr/bin/ar: creating aes.a Make process completed. Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (4xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 3888 c/s real, 967 c/s virtual fd@fdu:~/git/JtR/src$ git checkout 88b1a10889405a9f33690795368d1faa21c1c59b Note: checking out '88b1a10889405a9f33690795368d1faa21c1c59b'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at 88b1a10... Revert "bcrypt / opencl: created a BF_common set of functions / data" fd@fdu:~/git/JtR/src$ make -s distclean ; ./configure > /dev/null && make -s -j 8 && cd ../run/ && ./john --test --format=bcrypt; cd ../src/ DES_std.c: In function 'DES_std_set_key': DES_std.c:639:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ /usr/bin/ar: creating aes.a Make process completed. Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (4xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 5040 c/s real, 1253 c/s virtual fd@fdu:~/git/JtR/src$ git checkout bbe3e324121a55d40d845b7eea94cd0963951d95 Previous HEAD position was 88b1a10... Revert "bcrypt / opencl: created a BF_common set of functions / data" HEAD is now at bbe3e32... Merge branch 'master' into bleeding-jumbo fd@fdu:~/git/JtR/src$ make -s distclean ; ./configure > /dev/null && make -s -j 8 && cd ../run/ && ./john --test --format=bcrypt; cd ../src/ DES_std.c: In function 'DES_std_set_key': DES_std.c:639:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ /usr/bin/ar: creating aes.a Make process completed. Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (4xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 3825 c/s real, 966 c/s virtual ``` So, for some reasons, merging Solar's core changes caused this performance regression on my hardware: ``` $ head -n 25 /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz stepping : 3 microcode : 0x16 cpu MHz : 800.390 cache size : 6144 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm bogomips : 5986.37 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: ```
bsakaguchi 2026-10-14 03:22:16 +07:00
Author
Owner

@frank-dittrich commented on GitHub (Apr 11, 2015):

BTW:

Looks like you just missed some performance improvement bleeding-jumbo had over core john after you merged Solar's changes.

Core 1.8.0:

fd@fdu:~/git/JtR$ ./run/john  |head -n 1
John the Ripper password cracker, version 1.8.0
fd@fdu:~/git/JtR$ ./run/john --test --format=bcrypt 
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... DONE
Raw:    3811 c/s real, 953 c/s virtual

jumbo 1:

fd@fdu:~/git/JtR$ ./run/john |head -n 1
John the Ripper password cracker, version 1.8.0-jumbo-1_omp [linux-gnu 64-bit AVX2-autoconf]
fd@fdu:~/git/JtR$ ./run/john --test --format=bcrypt 
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (4xOMP) DONE
Raw:    5040 c/s real, 1253 c/s virtual

Note the X2 vs. X3 difference

<!-- gh-comment-id:91920630 --> @frank-dittrich commented on GitHub (Apr 11, 2015): BTW: Looks like you just missed some performance improvement bleeding-jumbo had over core john after you merged Solar's changes. Core 1.8.0: ``` fd@fdu:~/git/JtR$ ./run/john |head -n 1 John the Ripper password cracker, version 1.8.0 fd@fdu:~/git/JtR$ ./run/john --test --format=bcrypt Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... DONE Raw: 3811 c/s real, 953 c/s virtual ``` jumbo 1: ``` fd@fdu:~/git/JtR$ ./run/john |head -n 1 John the Ripper password cracker, version 1.8.0-jumbo-1_omp [linux-gnu 64-bit AVX2-autoconf] fd@fdu:~/git/JtR$ ./run/john --test --format=bcrypt Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (4xOMP) DONE Raw: 5040 c/s real, 1253 c/s virtual ``` Note the X2 vs. X3 difference
Author
Owner

@frank-dittrich commented on GitHub (Apr 11, 2015):

Apparently, the BF related changes of commit f64b42fee9 make the difference.
If I build linux-x86-64-native for this commit (this was before autoconf got introduced), I get

Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (4xOMP) DONE
Raw:    4954 c/s real, 1251 c/s virtual

With f212f89875, I get

Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (4xOMP) DONE
Raw:    3864 c/s real, 966 c/s virtual
<!-- gh-comment-id:91936089 --> @frank-dittrich commented on GitHub (Apr 11, 2015): Apparently, the BF related changes of commit f64b42fee9e368cd85cf546f08b694510824fea2 make the difference. If I build linux-x86-64-native for this commit (this was before autoconf got introduced), I get ``` Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (4xOMP) DONE Raw: 4954 c/s real, 1251 c/s virtual ``` With f212f898754a1b0ab000883f156917ab5b6b3c96, I get ``` Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (4xOMP) DONE Raw: 3864 c/s real, 966 c/s virtual ```
Author
Owner

@magnumripper commented on GitHub (Apr 11, 2015):

Try the latest core code from the master branch (d686010da) versus 1.8.0. Doesn't it show the same problem?

Note: You have to build for AVX or XOP for a comparable build.

<!-- gh-comment-id:91942098 --> @magnumripper commented on GitHub (Apr 11, 2015): Try the latest core code from the master branch (d686010da) versus 1.8.0. Doesn't it show the same problem? Note: You have to build for AVX or XOP for a comparable build.
Author
Owner

@frank-dittrich commented on GitHub (Apr 11, 2015):

Apparently, on well the current logic is almost 5 percent faster than the one which works best for me.
May be that's why Solar didn't enable this logic for avx.

When I test commit d686010da1 (latest master commit) on my system (linux-x86-65-native), I get

fd@fdu:~/git/JtR/run$ ./john --test --format=bcrypt 
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... DONE
Raw:    3796 c/s real, 949 c/s virtual

Similar for a generic build:

fd@fdu:~/git/JtR/run$ ./john --test --format=bcrypt 
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... DONE
Raw:    3830 c/s real, 958 c/s virtual

Apparently, Blowfish 32/64 X3 is not tested in a generic build:

Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1992 c/s real, 499 c/s virtual
Compiling: Blowfish benchmark (scale)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 2068 c/s real, 517 c/s virtual
Compiling: Blowfish benchmark (two hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 3830 c/s real, 958 c/s virtual

May be the benchmark should try X > 2, as long as the resulting c/s rate increases?

And may be we need to introduce --benchmark into out ./configure script?

<!-- gh-comment-id:91944832 --> @frank-dittrich commented on GitHub (Apr 11, 2015): Apparently, on well the current logic is almost 5 percent faster than the one which works best for me. May be that's why Solar didn't enable this logic for avx. When I test commit d686010da1febe937041177bd3f15f1f998a0544 (latest master commit) on my system (linux-x86-65-native), I get ``` fd@fdu:~/git/JtR/run$ ./john --test --format=bcrypt Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... DONE Raw: 3796 c/s real, 949 c/s virtual ``` Similar for a generic build: ``` fd@fdu:~/git/JtR/run$ ./john --test --format=bcrypt Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... DONE Raw: 3830 c/s real, 958 c/s virtual ``` Apparently, `Blowfish 32/64 X3` is not tested in a generic build: ``` Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1992 c/s real, 499 c/s virtual Compiling: Blowfish benchmark (scale) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 2068 c/s real, 517 c/s virtual Compiling: Blowfish benchmark (two hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 3830 c/s real, 958 c/s virtual ``` May be the benchmark should try X > 2, as long as the resulting c/s rate increases? And may be we need to introduce --benchmark into out ./configure script?
Author
Owner

@frank-dittrich commented on GitHub (Apr 11, 2015):

BTW, this patch to master helps creating a generic build with improved bcrypt performance for my system:

diff --git a/src/best.sh b/src/best.sh
index 5e671b1..0192183 100755
--- a/src/best.sh
+++ b/src/best.sh
@@ -122,11 +122,21 @@ echo "Compiling: Blowfish benchmark (two hashes at a time)"
 $MAKE bench || exit 1
 RES=`./bench 3` || exit 1
 if [ $RES -gt $MAX ]; then
+   MAX=$RES
    BF_X2=1
+   ./detect $DES_BEST $DES_COPY $DES_BS $MD5_X2 $MD5_IMM $BF_SCALE 3 > arch.h
+   rm -f $BF_DEPEND bench
+   echo "Compiling: Blowfish benchmark (three hashes at a time)"
+   $MAKE bench || exit 1
+   RES=`./bench 3` || exit 1
+   if [ $RES -gt $MAX ]; then
+       BF_X2=3
+   fi
 else
    BF_X2=0
 fi
fd@fdu:~/git/JtR/src$ make -s generic
Compiling: DES benchmark (code version #1)
DES_std.c: In function ‘DES_std_set_key’:
DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 545843 c/s real, 545843 c/s virtual
Compiling: DES benchmark (code version #2)
DES_std.c: In function ‘DES_std_set_key’:
DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
Benchmarking: descrypt, traditional crypt(3) [DES 48/64 128K]... 483328 c/s real, 483328 c/s virtual
Compiling: DES benchmark (code version #3)
DES_std.c: In function ‘DES_std_set_key’:
DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 563123 c/s real, 563123 c/s virtual
Compiling: DES benchmark (code version #4)
DES_std.c: In function ‘DES_std_set_key’:
DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 569318 c/s real, 569318 c/s virtual
Compiling: DES benchmark (code version #5)
DES_std.c: In function ‘DES_std_set_key’:
DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 539315 c/s real, 539315 c/s virtual
Compiling: DES benchmark (code version #4, no key copying)
DES_std.c: In function ‘DES_std_set_key’:
DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 570470 c/s real, 570470 c/s virtual
Compiling: DES benchmark (bitslice, code version #1)
DES_std.c: In function ‘DES_std_set_key’:
DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
Benchmarking: descrypt, traditional crypt(3) [DES 64/64]... 9350K c/s real, 2339K c/s virtual
Compiling: DES benchmark (bitslice, code version #2)
Benchmarking: descrypt, traditional crypt(3) [DES 64/64]... 9325K c/s real, 2332K c/s virtual
Compiling: DES benchmark (bitslice, code version #3)
Benchmarking: descrypt, traditional crypt(3) [DES 64/64]... 5585K c/s real, 1397K c/s virtual
Benchmarking: md5crypt [MD5 32/64]... 42086 c/s real, 10516 c/s virtual
Compiling: MD5 benchmark (two hashes at a time)
Benchmarking: md5crypt [MD5 32/64 X2]... 63770 c/s real, 15950 c/s virtual
Compiling: MD5 benchmark (immediate values)
Benchmarking: md5crypt [MD5 32/64 X2]... 65740 c/s real, 16435 c/s virtual
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1992 c/s real, 498 c/s virtual
Compiling: Blowfish benchmark (scale)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 2066 c/s real, 516 c/s virtual
Compiling: Blowfish benchmark (two hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 3830 c/s real, 958 c/s virtual
Compiling: Blowfish benchmark (three hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 4982 c/s real, 1245 c/s virtual
DES_std.c: In function ‘DES_std_set_key’:
DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^
fd@fdu:~/git/JtR/src$ ../run/john --test --format=bcrypt 
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... DONE
Raw:    4946 c/s real, 1237 c/s virtual

Tomorrow (after I got some sleep) I'll report my findings to john-dev, so that Solar can improve the generic build and may be reconsider setting BF_X2 to 3 even for avx systems.

<!-- gh-comment-id:91947203 --> @frank-dittrich commented on GitHub (Apr 11, 2015): BTW, this patch to master helps creating a generic build with improved bcrypt performance for my system: ``` diff --git a/src/best.sh b/src/best.sh index 5e671b1..0192183 100755 --- a/src/best.sh +++ b/src/best.sh @@ -122,11 +122,21 @@ echo "Compiling: Blowfish benchmark (two hashes at a time)" $MAKE bench || exit 1 RES=`./bench 3` || exit 1 if [ $RES -gt $MAX ]; then + MAX=$RES BF_X2=1 + ./detect $DES_BEST $DES_COPY $DES_BS $MD5_X2 $MD5_IMM $BF_SCALE 3 > arch.h + rm -f $BF_DEPEND bench + echo "Compiling: Blowfish benchmark (three hashes at a time)" + $MAKE bench || exit 1 + RES=`./bench 3` || exit 1 + if [ $RES -gt $MAX ]; then + BF_X2=3 + fi else BF_X2=0 fi ``` ``` fd@fdu:~/git/JtR/src$ make -s generic Compiling: DES benchmark (code version #1) DES_std.c: In function ‘DES_std_set_key’: DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 545843 c/s real, 545843 c/s virtual Compiling: DES benchmark (code version #2) DES_std.c: In function ‘DES_std_set_key’: DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ Benchmarking: descrypt, traditional crypt(3) [DES 48/64 128K]... 483328 c/s real, 483328 c/s virtual Compiling: DES benchmark (code version #3) DES_std.c: In function ‘DES_std_set_key’: DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 563123 c/s real, 563123 c/s virtual Compiling: DES benchmark (code version #4) DES_std.c: In function ‘DES_std_set_key’: DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 569318 c/s real, 569318 c/s virtual Compiling: DES benchmark (code version #5) DES_std.c: In function ‘DES_std_set_key’: DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 539315 c/s real, 539315 c/s virtual Compiling: DES benchmark (code version #4, no key copying) DES_std.c: In function ‘DES_std_set_key’: DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ Benchmarking: descrypt, traditional crypt(3) [DES 48/64 4K]... 570470 c/s real, 570470 c/s virtual Compiling: DES benchmark (bitslice, code version #1) DES_std.c: In function ‘DES_std_set_key’: DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ Benchmarking: descrypt, traditional crypt(3) [DES 64/64]... 9350K c/s real, 2339K c/s virtual Compiling: DES benchmark (bitslice, code version #2) Benchmarking: descrypt, traditional crypt(3) [DES 64/64]... 9325K c/s real, 2332K c/s virtual Compiling: DES benchmark (bitslice, code version #3) Benchmarking: descrypt, traditional crypt(3) [DES 64/64]... 5585K c/s real, 1397K c/s virtual Benchmarking: md5crypt [MD5 32/64]... 42086 c/s real, 10516 c/s virtual Compiling: MD5 benchmark (two hashes at a time) Benchmarking: md5crypt [MD5 32/64 X2]... 63770 c/s real, 15950 c/s virtual Compiling: MD5 benchmark (immediate values) Benchmarking: md5crypt [MD5 32/64 X2]... 65740 c/s real, 16435 c/s virtual Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1992 c/s real, 498 c/s virtual Compiling: Blowfish benchmark (scale) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 2066 c/s real, 516 c/s virtual Compiling: Blowfish benchmark (two hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 3830 c/s real, 958 c/s virtual Compiling: Blowfish benchmark (three hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 4982 c/s real, 1245 c/s virtual DES_std.c: In function ‘DES_std_set_key’: DES_std.c:635:17: warning: array subscript is above array bounds [-Warray-bounds] while (DES_key[i++]) k += 2; ^ fd@fdu:~/git/JtR/src$ ../run/john --test --format=bcrypt Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... DONE Raw: 4946 c/s real, 1237 c/s virtual ``` Tomorrow (after I got some sleep) I'll report my findings to john-dev, so that Solar can improve the generic build and may be reconsider setting BF_X2 to 3 even for avx systems.
Author
Owner

@frank-dittrich commented on GitHub (Apr 12, 2015):

I reported the regression here:
http://openwall.com/lists/john-dev/2015/04/12/4
http://thread.gmane.org/gmane.comp.security.openwall.john.devel/11239

Unfortunately, I forgot a link to this issue.

<!-- gh-comment-id:92031047 --> @frank-dittrich commented on GitHub (Apr 12, 2015): I reported the regression here: http://openwall.com/lists/john-dev/2015/04/12/4 http://thread.gmane.org/gmane.comp.security.openwall.john.devel/11239 Unfortunately, I forgot a link to this issue.
Author
Owner

@frank-dittrich commented on GitHub (Apr 12, 2015):

Some more data:
Intel(R) Core(TM) i7-2820QM CPU @ 2.30GHz (quad core with HT), generic build without OMP, also a 23% improvement:

Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 412 c/s real, 412 c/s virtual
Compiling: Blowfish benchmark (scale)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 455 c/s real, 455 c/s virtual
Compiling: Blowfish benchmark (two hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 807 c/s real, 807 c/s virtual
Compiling: Blowfish benchmark (three hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 999 c/s real, 1001 c/s virtual

With OMP enabled (8*OMP due to HT), just a 2% performance improvement:

Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1916 c/s real, 240 c/s virtual
Compiling: Blowfish benchmark (scale)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 2174 c/s real, 272 c/s virtual
Compiling: Blowfish benchmark (two hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 3200 c/s real, 400 c/s virtual
Compiling: Blowfish benchmark (three hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 3276 c/s real, 409 c/s virtual

With OMP_NUM_THREADS=4, a 25% improvement:

Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1276 c/s real, 320 c/s virtual
Compiling: Blowfish benchmark (scale)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1353 c/s real, 338 c/s virtual
Compiling: Blowfish benchmark (two hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 2423 c/s real, 606 c/s virtual
Compiling: Blowfish benchmark (three hashes at a time)
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 3046 c/s real, 762 c/s virtual
<!-- gh-comment-id:92032592 --> @frank-dittrich commented on GitHub (Apr 12, 2015): Some more data: Intel(R) Core(TM) i7-2820QM CPU @ 2.30GHz (quad core with HT), generic build without OMP, also a 23% improvement: ``` Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 412 c/s real, 412 c/s virtual Compiling: Blowfish benchmark (scale) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 455 c/s real, 455 c/s virtual Compiling: Blowfish benchmark (two hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 807 c/s real, 807 c/s virtual Compiling: Blowfish benchmark (three hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 999 c/s real, 1001 c/s virtual ``` With OMP enabled (8*OMP due to HT), just a 2% performance improvement: ``` Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1916 c/s real, 240 c/s virtual Compiling: Blowfish benchmark (scale) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 2174 c/s real, 272 c/s virtual Compiling: Blowfish benchmark (two hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 3200 c/s real, 400 c/s virtual Compiling: Blowfish benchmark (three hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 3276 c/s real, 409 c/s virtual ``` With OMP_NUM_THREADS=4, a 25% improvement: ``` Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1276 c/s real, 320 c/s virtual Compiling: Blowfish benchmark (scale) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64]... 1353 c/s real, 338 c/s virtual Compiling: Blowfish benchmark (two hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... 2423 c/s real, 606 c/s virtual Compiling: Blowfish benchmark (three hashes at a time) Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 3046 c/s real, 762 c/s virtual ```
Author
Owner

@jfoug commented on GitHub (Aug 31, 2015):

Try the latest core code from the master branch (d686010) versus 1.8.0. Doesn't it show the same problem?
Note: You have to build for AVX or XOP for a comparable build.

I have built on all 3 types (AVX, XOP, AVX2). I see improvements to all processors.

AVX2 I see abotu 25% or so (as what was reported by @frank-dittrich). XOP I see about 12% improvement, and AVX I see about 15% improvement.

But for all systems I have that are >= AVX I am seeing BF_X2=3 to be an improvement over BF_X2=1

<!-- gh-comment-id:136399310 --> @jfoug commented on GitHub (Aug 31, 2015): > Try the latest core code from the master branch (d686010) versus 1.8.0. Doesn't it show the same problem? > Note: You have to build for AVX or XOP for a comparable build. I have built on all 3 types (AVX, XOP, AVX2). I see improvements to all processors. AVX2 I see abotu 25% or so (as what was reported by @frank-dittrich). XOP I see about 12% improvement, and AVX I see about 15% improvement. But for all systems I have that are >= AVX I am seeing BF_X2=3 to be an improvement over BF_X2=1
Author
Owner

@frank-dittrich commented on GitHub (Aug 31, 2015):

I have a 36% performance improvement when changing BF_X2 from 1 to 3 for my i5-4570 CPU (quad core with AVX2 and ht, but number of logical cores = number of physical cores = 4), but Solar found a regression (either on super or on well or even on both) for BF_X2 = 3 compered ro BF_X2 = 1.

<!-- gh-comment-id:136405088 --> @frank-dittrich commented on GitHub (Aug 31, 2015): I have a 36% performance improvement when changing BF_X2 from 1 to 3 for my i5-4570 CPU (quad core with AVX2 and ht, but number of logical cores = number of physical cores = 4), but Solar found a regression (either on super or on well or even on both) for BF_X2 = 3 compered ro BF_X2 = 1.
Author
Owner

@jfoug commented on GitHub (Sep 1, 2015):

I wonder if this should be a configuration check, and not hard coded into x86-64.h ? @magnumripper what do you think about that idea? Or at least a configure check, that can OVERRIDE the value in x86-64.h

<!-- gh-comment-id:136799174 --> @jfoug commented on GitHub (Sep 1, 2015): I wonder if this should be a configuration check, and not hard coded into x86-64.h ? @magnumripper what do you think about that idea? Or at least a configure check, that can OVERRIDE the value in x86-64.h
Author
Owner

@frank-dittrich commented on GitHub (Sep 1, 2015):

What kind of check do you have in mind?
Something similar to the benchmark for make -f Makefile.legacy generic, except that you would try BF_X2 = 3 as well?
But then the build process can pick non-optimal values depending on varying system load.

<!-- gh-comment-id:136802617 --> @frank-dittrich commented on GitHub (Sep 1, 2015): What kind of check do you have in mind? Something similar to the benchmark for `make -f Makefile.legacy generic`, except that you would try BF_X2 = 3 as well? But then the build process can pick non-optimal values depending on varying system load.
Author
Owner

@frank-dittrich commented on GitHub (Sep 1, 2015):

May be we have to repeat Solar's test on super and well. The performance regression or improvement could also depend on compiler version.

<!-- gh-comment-id:136803323 --> @frank-dittrich commented on GitHub (Sep 1, 2015): May be we have to repeat Solar's test on super and well. The performance regression or improvement could also depend on compiler version.
Author
Owner

@magnumripper commented on GitHub (Sep 1, 2015):

I'm open for configure-time benchmarking, but it does have the caveat @frank-dittrich mentioned with system load.

If nothing else, we should wrap any #define BF_X2 in arch.h's with #ifndef BF_X2 ... #endif. That would mean you can override it at configure time (we wouldn't really need to add any option for it, just add it to CFLAGS or CPPFLAGS).

<!-- gh-comment-id:136809876 --> @magnumripper commented on GitHub (Sep 1, 2015): I'm open for configure-time benchmarking, but it does have the caveat @frank-dittrich mentioned with system load. If nothing else, we should wrap any `#define BF_X2` in arch.h's with `#ifndef BF_X2 ... #endif`. That would mean you can override it at configure time (we wouldn't really need to add any option for it, just add it to CFLAGS or CPPFLAGS).
Author
Owner

@jfoug commented on GitHub (Sep 1, 2015):

That is a viable alternative (the CPPFLAGS). It would be nice to find out the 'truth' about the regression. Possibly it was only OMP builds or something. From what I have seen it runs faster on all of my systems (xop, avx and avx2). Both under windows (cygwin), and a linux-64 VM. BUT by reading the comment, this is due to SMT-capable CPU's . Could that be something that is turned on, when running physical installed unix on these CPU's ?

But like frank mentioned, it may also be compiler version dependent and was a bug that has been fixed.

<!-- gh-comment-id:136811554 --> @jfoug commented on GitHub (Sep 1, 2015): That is a viable alternative (the CPPFLAGS). It would be nice to find out the 'truth' about the regression. Possibly it was only OMP builds or something. From what I have seen it runs faster on all of my systems (xop, avx and avx2). Both under windows (cygwin), and a linux-64 VM. BUT by reading the comment, this is due to SMT-capable CPU's . Could that be something that is turned on, when running physical installed unix on these CPU's ? But like frank mentioned, it may also be compiler version dependent and was a bug that has been fixed.
Author
Owner

@magnumripper commented on GitHub (Sep 1, 2015):

If nothing else, we should wrap any #define BF_X2 in arch.h's with #ifndef BF_X2 ... #endif.

Done.

<!-- gh-comment-id:136838589 --> @magnumripper commented on GitHub (Sep 1, 2015): > If nothing else, we should wrap any `#define BF_X2` in arch.h's with `#ifndef BF_X2 ... #endif`. Done.
Author
Owner

@magnumripper commented on GitHub (Sep 1, 2015):

i7-3615QM (Ivy Bridge, AVX), OSX, gcc 4.9.2

Non-OMP build:

$ ../run/john-no_omp_h24 -test -form:bcrypt
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... DONE
Speed for cost 1 (iteration count) of 32
Raw:    860 c/s real, 860 c/s virtual

$ ../run/john-no_omp-h24X3 -test -form:bcrypt
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... DONE
Speed for cost 1 (iteration count) of 32
Raw:    1089 c/s real, 1089 c/s virtual

OMP w/o HT:

$ OMP_NUM_THREADS=4 ../run/john-omp-h24 -test -form:bcrypt
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (4xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw:    3255 c/s real, 824 c/s virtual

$ OMP_NUM_THREADS=4 ../run/john-omp-h24X3 -test -form:bcrypt
Will run 4 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (4xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw:    3956 c/s real, 1009 c/s virtual

OMP w/ HT:

$ ../run/john-omp-h24 -test -form:bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw:    4368 c/s real, 624 c/s virtual

$ ../run/john-omp-h24X3 -test -form:bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw:    4562 c/s real, 628 c/s virtual

Improvement for X3 is 21-27% without HT. It's just 4% with HT - but still an improvement.

<!-- gh-comment-id:136891914 --> @magnumripper commented on GitHub (Sep 1, 2015): i7-3615QM (Ivy Bridge, AVX), OSX, gcc 4.9.2 Non-OMP build: ``` $ ../run/john-no_omp_h24 -test -form:bcrypt Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... DONE Speed for cost 1 (iteration count) of 32 Raw: 860 c/s real, 860 c/s virtual $ ../run/john-no_omp-h24X3 -test -form:bcrypt Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... DONE Speed for cost 1 (iteration count) of 32 Raw: 1089 c/s real, 1089 c/s virtual ``` OMP w/o HT: ``` $ OMP_NUM_THREADS=4 ../run/john-omp-h24 -test -form:bcrypt Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (4xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 3255 c/s real, 824 c/s virtual $ OMP_NUM_THREADS=4 ../run/john-omp-h24X3 -test -form:bcrypt Will run 4 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (4xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 3956 c/s real, 1009 c/s virtual ``` OMP w/ HT: ``` $ ../run/john-omp-h24 -test -form:bcrypt Will run 8 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (8xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 4368 c/s real, 624 c/s virtual $ ../run/john-omp-h24X3 -test -form:bcrypt Will run 8 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 4562 c/s real, 628 c/s virtual ``` Improvement for X3 is 21-27% without HT. It's just 4% with HT - but still an improvement.
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

github.com/magnumripper/JohnTheRipper@14685372f4 (commitcomment-14375823)

<!-- gh-comment-id:156507651 --> @magnumripper commented on GitHub (Nov 13, 2015): https://github.com/magnumripper/JohnTheRipper/commit/14685372f4394f3ffe8ba58f797deb9f01fcfba9#commitcomment-14375823
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

@frank-dittrich please test on that non-HT hardware you've got. We are now checking for hyperthreading with a cpuid call in autoconf, and use the results accordingly.

<!-- gh-comment-id:156567590 --> @magnumripper commented on GitHub (Nov 13, 2015): @frank-dittrich please test on that non-HT hardware you've got. We are now checking for hyperthreading with a cpuid call in autoconf, and use the results accordingly.
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

I'm not sure whether we should set X3 even for HT machines when not building OpenMP. I think I recall Solar argued against it (because X2 should be better for -fork too).

<!-- gh-comment-id:156569376 --> @magnumripper commented on GitHub (Nov 13, 2015): I'm not sure whether we should set X3 even for HT machines when not building OpenMP. I think I recall Solar argued against it (because X2 should be better for -fork too).
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

BTW the test runs fine on 32-bit too but I did not touch x86-sse2.h

<!-- gh-comment-id:156570216 --> @magnumripper commented on GitHub (Nov 13, 2015): BTW the test runs fine on 32-bit too but I did not touch x86-sse2.h
Author
Owner

@frank-dittrich commented on GitHub (Nov 13, 2015):

@magnumripper I did test on my CPU. /proc/cpuinfo reports ht capability, and autoconf detects ht capability, so BF_X2 is defined as 1. But 3 would be much better for my CPU.

Do we have a recent compiler version (gcc >= 5.0) on those systems where we see a regression with BF_X2 = 3? May be the value of BF_X2 should depend on gcc version?

<!-- gh-comment-id:156570375 --> @frank-dittrich commented on GitHub (Nov 13, 2015): @magnumripper I did test on my CPU. /proc/cpuinfo reports ht capability, and autoconf detects ht capability, so BF_X2 is defined as 1. But 3 would be much better for my CPU. Do we have a recent compiler version (gcc >= 5.0) on those systems where we see a regression with BF_X2 = 3? May be the value of BF_X2 should depend on gcc version?
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

But 3 would be much better for my CPU.

When actually using all available threads too?

I use gcc 5.2.0 and I definitely see a regression when running X3. That's measured with HT in use.

<!-- gh-comment-id:156571114 --> @magnumripper commented on GitHub (Nov 13, 2015): > But 3 would be much better for my CPU. When actually using all available threads too? I use gcc 5.2.0 and I definitely see a regression when running X3. That's measured **with** HT in use.
Author
Owner

@jfoug commented on GitHub (Nov 13, 2015):

It should not only depend upon compiler version. But right now, it bases 100% on the HT bit. That is not right logic either.

I use non-omp build running on 6 cores (with fork and a few stand alone), and it is MUCH faster than when built with X2=1. It also allows the machine to be useful. There is a tiny gain going to 7 runs, and almost none going to 8 threads. But even at 8 threads, it IS faster than OMP, and faster than X2=1 for fork=8

<!-- gh-comment-id:156571657 --> @jfoug commented on GitHub (Nov 13, 2015): It should not only depend upon compiler version. But right now, it bases 100% on the HT bit. That is not right logic either. I use non-omp build running on 6 cores (with fork and a few stand alone), and it is MUCH faster than when built with X2=1. It also allows the machine to be useful. There is a tiny gain going to 7 runs, and almost none going to 8 threads. But even at 8 threads, it IS faster than OMP, and faster than X2=1 for fork=8
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

right now, it bases 100% on the HT bit. That is not right logic either.

Then we should challenge Solar's statements in that thread on john-dev.

<!-- gh-comment-id:156571846 --> @magnumripper commented on GitHub (Nov 13, 2015): > right now, it bases 100% on the HT bit. That is not right logic either. Then we should challenge Solar's statements in that thread on john-dev.
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

You can obviously still ./configure CPPFLAGS=-DBF_X2=3 if you like. That overrules everything else.

<!-- gh-comment-id:156572183 --> @magnumripper commented on GitHub (Nov 13, 2015): You can obviously still `./configure CPPFLAGS=-DBF_X2=3` if you like. That overrules everything else.
Author
Owner

@jfoug commented on GitHub (Nov 13, 2015):

Just got this message:

"Sorry, AVX2 is required for this build"

Running on virtualbox. AVX2 worked just fine, until you added runtime checks.

<!-- gh-comment-id:156572376 --> @jfoug commented on GitHub (Nov 13, 2015): Just got this message: "Sorry, AVX2 is required for this build" Running on virtualbox. AVX2 worked just fine, until you added runtime checks.
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

That's odd. It's well tested.

<!-- gh-comment-id:156572470 --> @magnumripper commented on GitHub (Nov 13, 2015): That's odd. It's well tested.
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

Could my addition of HAVE_HT have had this side effect?

<!-- gh-comment-id:156572576 --> @magnumripper commented on GitHub (Nov 13, 2015): Could my addition of HAVE_HT have had this side effect?
Author
Owner

@jfoug commented on GitHub (Nov 13, 2015):

configure has given me AVX2 for a while (an update to VirtualBox about a year ago), and configure worked, as did all formats, doing AVX2

<!-- gh-comment-id:156572663 --> @jfoug commented on GitHub (Nov 13, 2015): configure has given me AVX2 for a while (an update to VirtualBox about a year ago), and configure worked, as did all formats, doing AVX2
Author
Owner

@jfoug commented on GitHub (Nov 13, 2015):

I am testing on cygwin-64 Nope, that one works fine.

<!-- gh-comment-id:156572763 --> @jfoug commented on GitHub (Nov 13, 2015): I am testing on cygwin-64 Nope, that one works fine.
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

I gave in and set it to 3 for non-OpenMP builds. It's unreasonable not to do so IMHO.

<!-- gh-comment-id:156578915 --> @magnumripper commented on GitHub (Nov 13, 2015): I gave in and set it to 3 for non-OpenMP builds. It's unreasonable not to do so IMHO.
Author
Owner

@magnumripper commented on GitHub (Nov 13, 2015):

On a side note I updated my fallback wiki page to include "native CPU, but with OpenMP fallback"

<!-- gh-comment-id:156582918 --> @magnumripper commented on GitHub (Nov 13, 2015): On a side note I updated my [fallback wiki page](https://github.com/magnumripper/JohnTheRipper/wiki/Fallback-binary-chains) to include "native CPU, but with OpenMP fallback"
Author
Owner

@jfoug commented on GitHub (Nov 16, 2015):

Here is on my CoreI7-HT AVX machine. X3 is quite a bit better, and much more 'stable'

$ ../run/john -test=5 -form=bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw: 4322 c/s real, 602 c/s virtual

$ ../run/john -test=5 -form=bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw: 3936 c/s real, 614 c/s virtual

$ ../run/john -test=5 -form=bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw: 4118 c/s real, 607 c/s virtual

$ ../run/john -test=5 -form=bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw: 4538 c/s real, 625 c/s virtual

$ ../run/john -test=5 -form=bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw: 4571 c/s real, 617 c/s virtual

$ ../run/john -test=5 -form=bcrypt
Will run 8 OpenMP threads
Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 32
Raw: 4536 c/s real, 609 c/s virtual

I am sorry, I still argue that the proper setting is 3x, always.

<!-- gh-comment-id:157091151 --> @jfoug commented on GitHub (Nov 16, 2015): Here is on my CoreI7-HT AVX machine. X3 is quite a bit better, and much more 'stable' $ ../run/john -test=5 -form=bcrypt Will run 8 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (8xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 4322 c/s real, 602 c/s virtual $ ../run/john -test=5 -form=bcrypt Will run 8 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (8xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 3936 c/s real, 614 c/s virtual $ ../run/john -test=5 -form=bcrypt Will run 8 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X2]... (8xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 4118 c/s real, 607 c/s virtual $ ../run/john -test=5 -form=bcrypt Will run 8 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 4538 c/s real, 625 c/s virtual $ ../run/john -test=5 -form=bcrypt Will run 8 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 4571 c/s real, 617 c/s virtual $ ../run/john -test=5 -form=bcrypt Will run 8 OpenMP threads Benchmarking: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... (8xOMP) DONE Speed for cost 1 (iteration count) of 32 Raw: 4536 c/s real, 609 c/s virtual I am sorry, I still argue that the proper setting is 3x, always.
Author
Owner

@jfoug commented on GitHub (Nov 16, 2015):

Is there any way to build both X2=1 and X2=3, and have runtime selection of the proper code?

<!-- gh-comment-id:157091802 --> @jfoug commented on GitHub (Nov 16, 2015): Is there any way to build both X2=1 and X2=3, and have runtime selection of the proper code?
Author
Owner

@frank-dittrich commented on GitHub (Nov 16, 2015):

@jfoug Apparently, you didn't test combinations of X2=1 and X2=3 (non-OMP) for max. number of logical cores.
When I tested on my laptop (Intel(R) Core(TM) i7-2820QM CPU @ 2.30GHz quad core, 8 logical cores), the best total combined c/s rate required running a mix of X2=1 and X2=3 binaries, while for just a single binary (or up to 4 binaries) X2=3 was better.

<!-- gh-comment-id:157110873 --> @frank-dittrich commented on GitHub (Nov 16, 2015): @jfoug Apparently, you didn't test combinations of X2=1 and X2=3 (non-OMP) for max. number of logical cores. When I tested on my laptop (`Intel(R) Core(TM) i7-2820QM CPU @ 2.30GHz` quad core, 8 logical cores), the best total combined c/s rate required running a mix of X2=1 and X2=3 binaries, while for just a single binary (or up to 4 binaries) X2=3 was better.
Author
Owner

@magnumripper commented on GitHub (Nov 16, 2015):

Is there any way to build both X2=1 and X2=3, and have runtime selection of the proper code?

Solar will fix it eventually, in JP. He already mentioned it.

I still argue that the proper setting is 3x, always.

You are arguing that a regression for me is the proper setting. There's no point in arguing about something that vary among CPUs. Besides, you should argue on john-dev, not here. This may trigger Solar to make the canonical fix.

<!-- gh-comment-id:157120993 --> @magnumripper commented on GitHub (Nov 16, 2015): > Is there any way to build both X2=1 and X2=3, and have runtime selection of the proper code? Solar will fix it eventually, in JP. He already mentioned it. > I still argue that the proper setting is 3x, always. You are arguing that a regression for me is the proper setting. There's no point in arguing about something that vary among CPUs. Besides, you should argue on john-dev, not here. This may trigger Solar to make the canonical fix.
Author
Owner

@frank-dittrich commented on GitHub (Mar 18, 2016):

Wow, you assigned 25 issues to me in just one minute.
Looking into all of these 25 issues will definitely take a little longer.

<!-- gh-comment-id:198347250 --> @frank-dittrich commented on GitHub (Mar 18, 2016): Wow, you assigned 25 issues to me in just one minute. Looking into all of these 25 issues will definitely take a little longer.
Author
Owner

@magnumripper commented on GitHub (Mar 19, 2016):

Heh, I just picked issues with no assignee and that was opened by you. I intend to do so with other openers too.

<!-- gh-comment-id:198681855 --> @magnumripper commented on GitHub (Mar 19, 2016): Heh, I just picked issues with no assignee and that was opened by you. I intend to do so with other openers too.
Author
Owner

@magnumripper commented on GitHub (Apr 10, 2019):

This is now "fixed" in core (actually X3 is always used) and we shall never mention it again

<!-- gh-comment-id:481854479 --> @magnumripper commented on GitHub (Apr 10, 2019): This is now "fixed" in core (actually X3 is always used) and we shall never mention it again
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#748
No description provided.