unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* The dynamic stack
@ 2012-03-03 16:25 Andy Wingo
  2012-03-06 17:20 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Wingo @ 2012-03-03 16:25 UTC (permalink / raw)
  To: guile-devel

Hi,

I have pushed a patch to master that changes the implementation of the
dynamic stack from being a linked list on the heap to being an actual
stack.  This allows us to push items on the stack in many cases without
allocating memory at all.

This has become particularly important in `master', because ports in
master have a similar locking discipline as stdio ports in glibc.  (See
"Streams and Threads" in the libc manual, for more.)  The upshot is that
there's a lot more scm_dynwind_pthread_mutex_lock in master, and that
was slowing things down noticeably.

This patch makes a simple "guile examples/web/debug-sxml.scm" server go
from serving 3215 reqs/s to 3830 reqs/s.  (Using "ab -n 100000 -c100
http://localhost:8080/" on the same machine to test; the machine is my
laptop.  By way of comparison, stable-2.0 does 3225 reqs/s on that
benchmark.)

Still, there are some things we can do to improve matters, especially
with regards to prompts.  If instead of storing a cookie, the VM did a
setjmp() on entry, we could avoid allocating a jmpbuf for each prompt.
This could bring some other code simplifications, notably, the cleanup
of partial_cont_call.

Anyway, these are disconnected ramblings.  Review is welcome; I'll try
to incorporate any feedback.  Cheers!

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-07 23:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-03 16:25 The dynamic stack Andy Wingo
2012-03-06 17:20 ` Ludovic Courtès
2012-03-06 20:32   ` Andy Wingo
2012-03-07  6:05     ` Noah Lavine
2012-03-07  9:51       ` Andy Wingo
2012-03-07 23:09     ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).