<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
In fact, once you change the test to (fx<= n 1),  the (inlining-limit 1000) doesn't change much; with it, I get
<PRE>
heine:~> gsc -exe  fib2_scm
heine:~> time ./fib2_scm
2.160u 0.000s 0:02.16 100.0%    0+0k 0+0io 0pf+0w
</PRE>
Without it, I get
<PRE>
heine:~> gsc -exe  fib2_scm
heine:~> time ./fib2_scm
2.280u 0.010s 0:02.29 100.0%    0+0k 0+0io 0pf+0w
</PRE>
If I add (inlining-limit 1000) to the original code with I get
<PRE>
heine:~> gsc -exe  fib_scm
heine:~> time ./fib_scm
2.140u 0.020s 0:02.16 100.0%    0+0k 0+0io 0pf+0w
</PRE>
If I declare (not interrupts-enabled) in fib (I know this is not a good idea, because stack overflows are not caught), I get with (inlining-limit 1000) and the revised code:
<PRE>
heine:~> gsc -exe  fib2_scm
heine:~> time ./fib2_scm
1.800u 0.010s 0:01.82 99.4%     0+0k 0+0io 0pf+0w
</PRE>
By the way, with
<PRE>
heine:~> /pkgs/chicken-4.6.0/bin/csc -O4 fib2_scm.scm
Warning: illegal declaration specifier: (inlining-limit 1000)
heine:~> time ./fib2_scm
3.080u 0.000s 0:03.08 100.0%    0+0k 0+0io 0pf+0w
</PRE>
while with
<PRE>
heine:~> /pkgs/chicken-4.6.0/bin/csc -O5 fib2_scm.scm
Warning: illegal declaration specifier: (inlining-limit 1000)
heine:~> time ./fib2_scm
0.970u 0.010s 0:00.98 100.0%    0+0k 0+0io 0pf+0w

</PRE>
I don't know what the various optimization levels of chicken mean precisely, or which options in -O5 makes the biggest difference over -O4:
<PRE>
<TT>    </TT><TT>-optimize-level 0          is equivalent to -no-usual-integrations -no-compiler-syntax</TT>
<TT>    </TT><TT>-optimize-level 1          is equivalent to -optimize-leaf-routine</TT>
<TT>   </TT><TT> </TT><TT>-optimize-level 2          is equivalent to -optimize-leaf-routines -inline</TT>
<TT>    -optimize-level 3          is equivalent to -optimize-leaf-routines -local -inline -inline-global</TT>
<TT>    -optimize-level 4          is equivalent to -optimize-leaf-routines -local -inline -unsafe -unboxing</TT>
<TT>    -optimize-level 5          is equivalent to -optimize-leaf-routines -block -inline -unsafe -unboxing -lambda-lift -disable-interrupts -no-trace -no</TT>-lambda-info
</PRE>
Marc, you know that with me and Gambit it's like the old Velvet Underground song: "I'm sticking with you, cause I'm made out of glue ..."<BR>
<BR>
Brad
</BODY>
</HTML>