Git doesn’t diff every file.
It first checks cheap metadata (mtime and file size) for each tracked file. If those match the index, Git skips the file. If they don’t match, Git then reads the file, hashes its content and compares it to the index version. Only those “suspect” files get fully diffed.