IRC channel logs

2022-08-20.log

back to list of logs

<lambdadog>Hi, working on embedding Guile into my wayland compositor -- is there a benefit to binding with `scm_c_define_gsubr` vs defining+`scm_pointer_to_procedure`?
<lambdadog>I'd like to organize things into modules, so an immediate benefit is being able to use `scm_c_module_define`, but is there a performance impact to not defining it as a primitive?
<lambdadog>I'm using Zig rather than C, so function snarfing is a non-consideration.
<daviid>can anyone spot my mistake, here https://paste.centos.org/view/93eee9da
<daviid>^^ a define-syntax syntax-rules quiz
<flatwhatson>daviid: is it the (not name) on line 15?
<daviid>flatwhatson: i don't think so, you can remove it and just keep (unless (defined? 'name) (toplevel-define! 'name (make <generic> #:name 'name))), i stil get he warning
<daviid>flatwhatson: the code is an early wip for something that will become farmore complex, so far, nearly a identical copy of the correponding define-methodin goops
<daviid>(oop goops), see line 2045 and below ...
<daviid>i have little experience using define-syntax syntax-rules, hence my ask for help
<lilyp>daviid: correct me if I wrong, but I suppose 'name will not be the name you want :P
<daviid>lilyp: whyisitused this way in define-method then?
<daviid>not sure what you mean either
<lilyp>hmm, my bad then
<daviid>lilyp: here http://git.savannah.gnu.org/cgit/guile.git/tree/module/oop/goops.scm#n2045
<lilyp>hmm, I think your problem might be in load
<lilyp>try to wrap it in an (eval-when (compile load eval))
<lilyp>well, if it was a script I'd do that at least
<lilyp>FWIW it does actually define bar
<lilyp>Okay, so https://paste.gnome.org/pkUr0Wn29 already exhibits the same behaviour
<lilyp>I think the macro is eagerly expanded leading to spurious warnings
<ArneBab>wingo: regarding your heap size comment in your blog: I increased the initial heap size of Guile by factor 10 (libguile/gc.c: DEFAULT_INITIAL_HEAP_SIZE) and ran the r7rs-benchmarks. That decreased the total runtime for me from 19 minutes to 15 minutes.
<ArneBab>wingo: taking the geometric mean gives 25% reduced runtime — with increased initial heap Guile is 33% faster.
<ArneBab>wingo: in the string test, it’s actually factor 3.5 faster and in the pi-test it’s almost factor 9.
<ArneBab>So maybe the heuristic of taking the result of guile -c "(display (assq-ref (gc-stats) 'heap-total-allocated))" is suboptimal
<ArneBab>I’ll run some tests how the benchmarks change with slightly increased initial heap.
<ArneBab>when I increase the initial heap size by factor 16, the memory requirement I see in the system monitor only increases from 2.9 MiB to 3.0MiB, shared memory increases from 9.5 to 10MiB and virtual memory increases from 110MiB to 117MiB.
<ArneBab>But the benefits in the benchmarks already decline after heap x4
<ArneBab>But the benefits in the benchmarks already decline after heap x4
<ArneBab>Currently this looks like an optimization problem. Geometric means of the r7rs benchmarks by ecraven:
<ArneBab>Guile-3.0.8.32-C7465-Initial-Heap-X8 1.0787622037419784 (56 / 56)
<ArneBab>Guile-3.0.8.32-C7465-Initial-Heap-X4 1.0974080188621567 (56 / 56)
<ArneBab>Guile-3.0.8.32-C7465-Initial-Heap-X2 1.183330061961961 (56 / 56)
<ArneBab>Guile-3.0.8-Release-Guix 1.341689505436264 (56 / 56)
<ArneBab>this is the geometric mean of the slowdown compared to the fastest run. x16 and x32 are not finished yet.
<mwette>david: change (begin to '(begin and see what you get
<mwette>^ just to debug
<stis>tja guilers!
***chris is now known as Guest2317
<stis>Not doing much programmin atm, just some theoretical physic stuff trying to bust things I think is weird in the theories we use
<stis>typically stuff like this: http://itampe.com/the-double-slit-strangity.html
<daviid>mwette: here - https://paste.centos.org/view/804dd524 -
***arbn` is now known as arbn
***arbn is now known as Guest8777
***arbn` is now known as arbn
<mwette>on line 36 you reference baz
<mwette>you may need to use something like (variable-ref (module-ref module 'bar))
<lilyp>real pros write macros in tree-il 😎️
<ArneBab>wingo: I sent an email to guile-devel with my findings on the initial heap size.