Get the latest tech news
Making my debug build run 100x faster so that it is finally usable
Published on 2025-02-18 SIMD and dedicated silicon to the rescue. Discussions: /r/C_Programming, HN I am writing a torrent application, to download and serve torrent files, in C, because it's fun.
I read that some torrent clients prefer to skip this verification at startup because they persist their state in a separate file (perhaps a Sqlite database), each time a new piece is downloaded (and its hash is verified). But when I build my code in debug mode (no optimizations) with Address Sanitizer, to detect various issues early, startup takes 20 to 30 seconds(hashing at roughly ~ 18 KiB/s)! If you are interested in this kind of thing, the OpenSSL project (and the various clones and forks) has a Perl script to generate assembly code to do SHA1 with various variants of SIMD and SHA extension.
Or read this on Hacker News