0

I have Kingston 2 TB M2 SSD. It has about 3000 MB per second reading.

However when I use the below code, the reading speed is about 153 MB per second even for very large files.

The application exe running in x64 and administrator mode.

How can I speed it up?

I am reading files to calculate their sha256 hash values for comparing.

using (var stream = File.Open(FilePath, FileMode.Open, FileAccess.Read))
{
    byte[] hash = SHA256.ComputeHash(stream);
}

.net Core 7 WPF application

Clemens
  • 123,504
  • 12
  • 155
  • 268
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
  • 3
    Does this answer your question? [What is the fastest way to create a checksum for large files in C#](https://stackoverflow.com/questions/1177607/what-is-the-fastest-way-to-create-a-checksum-for-large-files-in-c-sharp) – Heretic Monkey Dec 23 '22 at 20:47
  • 1
    `... calculate their sha256 hash values for comparing` - that's probably inefficient. – 500 - Internal Server Error Dec 23 '22 at 21:08

0 Answers0