1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-19 19:20:23 +02:00

Speed up the self-tail-recursive case (1x->2x)

* benchmark/lib.scm: Add a comment, update the loop disassembly. Loop is
  now faster in the VM, thankfully.

* src/vm_engine.h (CACHE_PROGRAM): Only release and regrab the object
  array handle if the program changed. That is to say, optimize the
  self-tail-recursive case. But perhaps the thing to optimize here are
  the procedure calls themselves. Worth looking at in the future.
This commit is contained in:
Andy Wingo 2008-05-25 13:34:50 +02:00
parent 22bcbe8cc9
commit e677365cbc
2 changed files with 57 additions and 68 deletions

View file

@ -140,14 +140,16 @@
{ \
ssize_t _vincr; \
\
bp = SCM_PROGRAM_DATA (program); \
/* Was: objects = SCM_VELTS (bp->objs); */ \
if (bp != SCM_PROGRAM_DATA (program)) { \
bp = SCM_PROGRAM_DATA (program); \
/* Was: objects = SCM_VELTS (bp->objs); */ \
\
if (objects) \
scm_array_handle_release (&objects_handle); \
if (objects) \
scm_array_handle_release (&objects_handle); \
\
objects = scm_vector_writable_elements (bp->objs, &objects_handle, \
&object_count, &_vincr); \
objects = scm_vector_writable_elements (bp->objs, &objects_handle, \
&object_count, &_vincr); \
} \
}
#define SYNC_BEFORE_GC() \