IRC channel logs

2021-10-09.log

back to list of logs

<RhodiumToad>that's the same paste twice
<ruffni>sorry, https://termbin.com/1cyp
<RhodiumToad>oh, the second version of the pasted code uses algorithm: rather than algo:
<RhodiumToad>I de-abbreviated that in all the visible places
<ruffni>ah, yeah
<ruffni>huh, lampilelo left? is there a way to leave a message for them here?
<RhodiumToad>say "sneek, later tell lampilelo ..."
<RhodiumToad>sneek, botsnack
<sneek>:)
<RhodiumToad>oh good, it's working
<ruffni>sneek, later tell lampilelo you wondered about the performance of the two (ffi and pure scheme) implementations of sha1? https://termbin.com/prd9s test data was 10MiB of random bytes
<sneek>Okay.
<RhodiumToad>a mere three orders of magnitude?
<ruffni>the pure scheme implementation is almost unbearably slow
<RhodiumToad>not really surprising
<RhodiumToad>I note it has a lot of non-inlined calls to bitwise ops
<RhodiumToad>when I was testing my fast hex conversion code, I found that the overhead of using standard rnrs or srfi-60 bitwise ops rather than guile primitives like (ash) was a really big factor
<ruffni>and i think the pure scheme version is buggy: for the 10MiB file the hashes are equal, but for a 1MiB random data file the ffi hash is fdab659b319221775855fab1d1eb59ff611a while the scheme implementation gives: fd0ab659b31922010775855fab1d1eb509ff611a
<ruffni>when removing all the zeroes from the latter it's the same as the former
<RhodiumToad>bug in the hex conversion?
<ruffni>probably, i guess
<ruffni>ah yes, my bad
<ruffni>the latter is the correct one
<RhodiumToad> https://github.com/RhodiumToad/scheme-bits/blob/master/hex/hex.scm <-- fast hex conversions
<RhodiumToad>has a slightly nontrivially sized (~13k) lookup table for the hex to binary direction
<ruffni>i thought i could just `(format #f "~{~x~}" (bytevector->u8-list bytevec))` :)
<RhodiumToad>yeah, but that's not fast and does a hell of a lot of consing
<RhodiumToad>also you need ~2,'0x or something like that
<ruffni>yes, that made the difference
<ruffni>but in this case, this does not even really factor into what makes it slow (it's only applied to convert the bytevectors from your ffi code)
<RhodiumToad>right
<RhodiumToad>the fast hex conversions were written for something else
<ruffni>gotta go, thanks again, i learned quite a bunch tonight!
<RhodiumToad>sneek, later tell ruffni I put my version up at https://github.com/RhodiumToad/scheme-bits/blob/master/libcrypto/hash.scm
<sneek>Got it.
<lampilelo>i see the code length increased by ~50 lines while i was asleep
<sneek>lampilelo, you have 1 message!
<sneek>lampilelo, ruffni says: you wondered about the performance of the two (ffi and pure scheme) implementations of sha1? https://termbin.com/prd9s test data was 10MiB of random bytes
<lampilelo>wow that's quite a difference
<RhodiumToad>most of the increase is the (define-module) form and all those blank lines
<lampilelo>i see now that there is a guile library for gcrypt too, cool
<stis>Hej guilers!
<morganw>Could I ask, if using Geiser is it normal to disable the debug window which appears on error? It seems to just be a text representation of the actual debug prompt and not offering any debug features in itself.
<lampilelo>morganw: you mean *Geiser dbg* buffer?
<lampilelo>it doesn't show just errors, this is where all the standard output and standard error messages are printed
<morganw>That is the one, yes. I guess I haven't experimented enough to know all the purposes of it. Superficially it just seemed to be a copy of the error in the REPL with a link to jump to the file.
<lampilelo>i rarely use the repl buffer, i evaluate code right from the source file buffer and the dbg window shows me the output
<morganw>And just to double check, within the debugger I can fix problems and continue but there isn't an equivalent of a retry at the original point of failure (similar to what is offered with SLIME)?
<stis>Hello guilers!
<stis>Just back from seeing Dune, what an experience, my taste torally
<stis>eh totally
<stis>So now I will take a cup of coffee and write some doocumentation