hellzerg/hashing

Hashing(v3.4) calculating sha256 is slower than 7-Zip(v21.07)

user336598776 opened this issue ยท 20 comments

testing file is: cn_windows_10_business_editions_version_20h2_x64_dvd_f978664f.iso(5.49GiB)

on win7 64bit system:
Hashing(v3.4) sha256 time is 50 sec
7-Zip(v21.07) sha256 time is 38 sec

7-Zip:
https://7-zip.org
https://sourceforge.net/projects/sevenzip/files/7-Zip/

Yes, maybe it would speed up the hashing process.
I will build it in a few days, because I do not currently have a laptop.

Yes, maybe it would speed up the hashing process. I will build it in a few days, because I do not currently have a laptop.

OK, waiting.

Are you sure Hashing EXE is not 64-bit in Task Manager?

Are you sure Hashing EXE is not 64-bit in Task Manager?

yes ,it's 64bit on taskmgr:
64bit

i tested Hashing on win7 32bit vbox and win7 64bit vbox. (vbox = VirtualBox)
Hashing on win7 32bit vbox is slower than Hashing on win7 64bit vbox.

but Hashing sha256 is slower than 7-Zip sha256.

the Hashing exe file is 32bit:
exe_file_is_32bit
maybe you can try to build a 100% 64bit exe file(dll file is also 64bit).

Detect It Easy[DiE] download:
https://github.com/horsicq/DIE-engine/releases

[sha256 time compare]

testing on VirtualBox Win10(20h2) 64bit

file size is: 2.65GiB

7-Zip v21.07 64bit: 22sec, 21sec, 21sec

Hashing v3.4: 24sec, 24sec, 24sec

Win10(20h2)powershell 64bit: 28sec, 27sec, 27sec

powershell batch file code is:
@echo off
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Command "Get-FileHash 'E:\sources\install.wim' -Algorithm SHA256"
pause

I'll see if it can be built 100% in 64-bit in Visual Studio.

But the timings are good in your last message.

But the timings are good in your last message.

[sha256 time compare]

testing on Win7 64bit (not VM VirtualBox) (16G memory)

file size is: 2.65GiB

7-Zip v21.07 64bit: 19sec, 18sec, 18sec

Hashing v3.4: 24sec, 24sec, 24sec

on my pc, running vbox Win10(20h2) (8G memory) is slow(not fast), slower than win7 system

Slow calculation time may be related to virtualization layer?

Slow calculation time may be related to virtualization layer?

i mean running vbox win10(20h2) system is slow, do everything is slower than win7 system.
i just list the detail

Yes, that's not unusual. It's a VBox system and not a native one.

Yes, that's not unusual. It's a VBox system and not a native one.

Maybe some time later, you can solve this issue. However Hashing 3.4 is still very good software.

I don't know if anything can be done to improve the speed, since it's based on .NET Framework. I hope it's just doing its work decently.

Hashing-3.4-x64-test.zip

This is an x64 binary of Hashing for testing.

Hashing-3.4-x64-test.zip

This is an x64 binary of Hashing for testing.

thanks for building it.

[sha256 time compare]

testing on Win7 64bit (not VM VirtualBox) (16G memory)

file size is: 2.65GiB

7-Zip v21.07 64bit: 20sec, 19sec, 19sec

Hashing-3.4-x64-test: 24sec, 24sec, 24sec

Hashing v3.4: 24sec, 24sec, 24sec

it seems that they are the same speed (Hashing-3.4-x64-test and Hashing v3.4)

Well, the difference is only 4-5 seconds. It's very decent.

Well, the difference is only 4-5 seconds. It's very decent.

the later testing file size is 2.65GiB, not 5.49GiB

7-Zip changelog 15.05 beta 2015-06-14

  • Speed optimizations for BCJ2 filter and SHA-1 and SHA-256 calculation.

7-Zip version >= 15.05 , the speed of sha256 calculation is good.

7-Zip source code: https://sourceforge.net/projects/sevenzip/files/7-Zip/

[sha256 time compare]

testing on Win7 64bit (not VM VirtualBox) (16G memory)

file size is: 2.65GiB

7-Zip v21.07 64bit sha256 time: 20sec 18sec 18sec
7z1900-x64 sha256 time: 19sec 19sec 19sec
7z1505-x64 sha256 time: 19sec 19sec 19sec

7z938-x64 sha256 time: 44sec 43sec 44sec (bad speed)

Hashing v3.4 sha256 time: 24sec 25sec 24sec

This is an absolutely meaningless issue. One cannot compare a C++ program (7-Zip) with with a C# program (Hashing). C++ software will always be faster and lighter than C# software as language and framework limitations cannot be overcome. The same way one cannot compare Delphi/Pascal programs with C++ programs as Delphi/Pascal stuff is generally faster and lighter than C++ stuff, the same way Assembly programs are even faster and lighter and beat all other languages.

I think that Hashing is excellent for a C# program.

@user336598776

Your measurements are pointless, better close this issue.

This is an absolutely meaningless issue. One cannot compare a C++ program (7-Zip) with with a C# program (Hashing). C++ software will always be faster and lighter than C# software as language and framework limitations cannot be overcome. The same way one cannot compare Delphi/Pascal programs with C++ programs as Delphi/Pascal stuff is generally faster and lighter than C++ stuff, the same way Assembly programs are even faster and lighter and beat all other languages.

I think that Hashing is excellent for a C# program.

@user336598776

Your measurements are pointless, better close this issue.

OK