Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
Geth MoarVM: 8f90dc7c15 | (Daniel Green)++ | 3rdparty/sha1/sha1.c
Speedup creating sha1 digest string

Instead of using sprintf to convert the byte array into the hex string, just implement the conversion manually.
  `my $a; my int $i := 0; my int $s := nqp::time; while $i++ < 1_000_000 { $a := nqp::sha1("a") }; say(nqp::div_n(nqp::time - $s, 1000000000)); say($a)`
goes from ~1.44s to ~0.48s. However, real-life impact will be much less, since we usually hash much larger strings and then the main cost is the UTF8 encoding and actual hashing.
02:33
MoarVM: 1730fd55a7 | MasterDuke17++ (committed using GitHub Web editor) | 3rdparty/sha1/sha1.c
Merge pull request #1731 from MasterDuke17/speedup_creating_sha1_digest_string

Speedup creating sha1 digest string