[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mon, 13 Aug 2012 18:47:16 +0200
Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.1 (gnu/linux)
Mark H Weaver <address@hidden> 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.