Hello,

Mark H Weaver <m...@netris.org> skribis:

> Here's one specific data structure idea: we have a "vlist" data
> structure, currently written in Scheme, but in my opinion it would be
> useful to rewrite it in C for better efficiency.

FWIW, I’m not convinced that this is a fruitful approach.

First, because Guile 2.0 has allowed us to write more things in Scheme,
and I’d like to keep it this way.  ;-)

Second, because a very important optimizations would rather be to fiddle
with the GC so that vlists, which are base + offset pairs, would not
have to be heap-allocated, as vlist.scm says:

  ;; XXX: Allocating a <vlist> record in addition to the block at each
  ;; `vlist-cons' call is inefficient.  However, Bagwell's hack to avoid it
  ;; (Section 2.2) would require GC_ALL_INTERIOR_POINTERS, which would be a
  ;; performance hit for everyone.

I remember Andy did some measurements showing that ‘vhash-assoc’ was
often high in the profile when running the compiler.  One thing that
could be done is to run a C-level profiler to see exactly what’s going
on, and which optimizations could help.

WDYT?

Thanks,
Ludo’.


Reply via email to