IRC channel logs
2026-03-22.log
back to list of logs
<ekaitz>ieure: did you try the example from the docs? that should work <ieure>ekaitz, Yes, all it does is print "No samples recorded." <ieure>Oh, I see. That does print something. <ekaitz>maybe your code is optimized away :S <ieure>(operating-system (inherit (operating-system (inherit (operating-system (bootloader #f) (host-name "test") (file-systems #f)))))) <ieure>This does almost nothing, but it takes ~25s to evaluate on a pretty fast machine. <ekaitz>civodul should probably know better how to do this, because it involves guile <ekaitz>and probably most of that is not calling things but expanding and running things on the daemon <ieure>The daemon isn't involved at all. <ieure>It's creating records and copying fields between them. <ieure>Even if it was calling the daemon, I'd see that reflected in the (current-time) calls before/after the form that gets evaluated. <ieure>And as I mentioned -- the values are identical to the second, even though it takes 25s to eval the code. <ieure>I used the stopwatch function of my phone to time it since I can't make Guile measure what I'm seeing. <ekaitz>that's weird and surely has a good explanation <ekaitz>but I don't have an answer for it <ieure>Thought maybe it was the printer, changed it to (begin (operating-system ...) #f), but it's still very very very slow. <ieure>It should be trivial to replicate if you have Guix. <ekaitz>the expression takes forever to run <ekaitz>now the question is, what is it running actually? <ekaitz>macro expanding it creates a HUGE piece of code <ekaitz>and now running with the statprof <ekaitz>it's probably something guix does <ieure>Well, there are two issues, right? One is the poor performance of the Guix code, the other is that being invisible ro Guile's profiling tools. <ieure>And I'm really only interested in the latter at this time. <ieure>That seems like a Guile issue, right? <graywolf>civodul suggested ,o optimization-level 1 as workaround <ieure>graywolf, Similar but different issue. Constructing the record isn't slow, but inheriting is extremely slow and gets worse-than-quadratically slower with every level of inheritance added. <ieure>What I'm trying to do is quantify how bad it is, so I can make a useful bug report. <ieure>This is also not just REPL slowness. <ieure>If I invoke from the shell with `time guile -c ...', it takes 1.5s for three levels of inheritance, 34s for four, and I started timing five levels, that's been running for 6m40s so far, using 100% CPU, and 10gb RAM. <ieure>Which seems just completely nuts. <graywolf>Oh, macro expansion shows a lot of code, the inherited packages is expanded over and over and over <graywolf>(operating-system (inherit (begin (pk 'x) (operating-system (bootloader #f) (host-name "test") (file-systems #f))))) is illuminating <ieure>(begin (define %os (operating-system (bootloader #f) (host-name "test") (file-systems #f))) (operating-system (inherit (begin (pk 'x) %os)))) <ieure>graywolf, Thank you very much for the help. <graywolf>Is scm_make_foreign_object_1 subject to non-local exits? I am thinking how to safely wrap external pointer in a foreign object. Based on the manual it seems that db = ...; scm_make_foreign_object_1(conn_type, db); could leak memory given the right conditions. <graywolf>Do I need to wrap it in scm_dynwind_begin? <ekaitz>rlb: reproduced the fibers segfault <ekaitz>i reproduced on a remote machine, which is a little bit of a pain in the balls to deal with but i'll manage