SHA3 speed PB540 include vs SHA3 module ?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

SHA3 speed PB540 include vs SHA3 module ?

Post by walbus »

For debugging i have maked my new QUICk-AES-256 3.0 source compatible to PB531.
So far, i have change the PB SHA3 function with the here available SHA3 module.
The tool use exzessive hashes and i see, with the SHAs Module a speed up from about 40% all over.
Now, i think, PB540 use also this module, or a other ??
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by Fred »

What's the bug exactly ? Which module do you talk about ?
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by wilbert »

The output of the PB hashes is fine so no bug.

I think walbus is referring to the module in this thread http://www.purebasic.fr/english/viewtop ... 12&t=56420 which contains implementations Sec and I created taking advantage of features like MMX, SSE2 or 64 bit.
I suppose PB uses the reference C implementation without such optimizations which would explain why it might be slower.
Windows (x64)
Raspberry Pi OS (Arm64)
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by Fred »

I see, then moved to feature request.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by walbus »

Yep, Wilbert, this is it.
It thoughts me it with MMX and other optimizations in the module.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by wilbert »

walbus wrote:Yep, Wilbert, this is it.
It thoughts me it with MMX and other optimizations in the module.
The fastest one in that thread is the one optimized for x64 http://www.purebasic.fr/english/viewtop ... 88#p464988 but you are right that the MMX one is also faster as the PB implementation.
A big advantage of the PB implementation is that it will run on very old hardware as well.

Since all x64 processors support MMX, SSE1 and SSE2, it would be nice if the x64 versions of PureBasic would use optimized versions of the C sources if available.
Windows (x64)
Raspberry Pi OS (Arm64)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by walbus »

Yep Wilbert, this SHA3 Module is a great work, fantastic !
This module for x64, yuo write above, i have tested in my code in this summer.
I have become a Assembler Error.
Unfortunately, my latest Assembler programming was with a Commodore 64 - LOL.

Now, this Weekend i test it again inside my new code.

If you want, i can you send the error result with PN, i think for you it is no problem to fix it.

But, i must test it before again.

I write you the result and the resulted speed up so far it works.

I have encoded a video for testing, about 1.35GB (My test Video)
With the SHA3 Module about 18 sek, with the PB540 coder about 36 sek, this is a lot !
I create hashes on demand and include the result in the encrypted containers, this is unmanipulable.
Check is then automatic, after the decryption, it works great, quick and absolutely sure for authentication the content.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by wilbert »

walbus wrote:If you want, i can you send the error result with PN, i think for you it is no problem to fix it.
If there is a compile error with my code, I would appreciate it if you have some test code causing the error so I can try to fix it.
Windows (x64)
Raspberry Pi OS (Arm64)
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by walbus »

Great, i try it, i have some free time today.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by walbus »

Ready and all OK Wilbert, 18% speed up with the x64 module !
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: SHA3 speed PB540 include vs SHA3 module ?

Post by GPI »

wilbert wrote:A big advantage of the PB implementation is that it will run on very old hardware as well.
In the compiler-Option is a an option to select which level of addtitional CPU-things should the created exe support, also a dynamic one. It should be possible, that a PB-exe detect which things the cpu support and choose the fastet code.
Post Reply