chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] "argvector" chicken


From: Mario Domenech Goulart
Subject: Re: [Chicken-hackers] "argvector" chicken
Date: Tue, 21 Jul 2015 19:37:34 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Hey Felix,

On Tue, 21 Jul 2015 18:28:19 +0200 address@hidden wrote:

> The new approach passes all arguments in a stack-allocated C_word
> array. Since CPS calls never return, the array just gets popped after
> the next minor garbage collection. The advantage is that CPS calls
> become much simpler (including the code that compiles this) as every
> CPS function is of type
>
>   void (func)(C_word c, C_word *av) [noreturn]
>
> The disadvantage is more allocation in the nursery. This doesn't
> increase GC time as such, because only live data is traced during a
> reclamation, but may increase the number of minor collections (the
> nursery fills up faster.)
>
> The system seems to work, I was able to run the tests-suite
> completely. I have not tested any other code so far. The performance
> is, surprisingly (and according to my experiments, which may be
> flawed), quite good. Actually not significantly slower and in some
> cases even faster. This is strange, and more real-world testing with
> long-running, heavily-allocating code may have different results. On
> the other hand CPS calls are much simpler, there is no need to use
> varargs (with a few small exceptions), the implementation of multiple
> values and argument-save/-restore is vastly simpler and the code is
> smaller, as "trampolines" (C functions that take arguments saved in a
> previously triggered GC and unpacks them, calling the original
> function again) can be completely dropped.

That's awesome, Felix.  Thanks a lot.

I've run chicken-benchmarks to compare argvector with master.  I haven't
observed serious performance regressions.  Some programs are slower and
some are faster (in the end arvector is slightly slower).  As you
predicted, argvector causes more garbage collections, and that can be
seen on the GC statistics.

The results are here:
http://paste.call-cc.org/paste?id=a51be75f8f21e763c580dff2aca619aa300c6be9

The system I ran the benchmarks on has an Intel(R) Core(TM)2 Duo CPU
E6750 processor at 2.66GHz (64bit) and runs Debian GNU/Linux with GCC
4.7.2.

I've also installed a couple of eggs and everything seems to have run
smoothly so far (quick test, admittedly):

$ ~/local/chicken-argvector/bin/chicken-status | wc -l
127

argvector's libchicken is ~200KB smaller on my system (after stripping):

$ ls -l libchicken.so.7 # argvector
-rwxr-xr-x 1 mario mario 3775984 Jul 21 16:10 libchicken.so.7

$ ls -l libchicken.so.7 # master
-rwxr-xr-x 1 mario mario 3973216 Jul 21 16:10 libchicken.so.7

I haven't observed any bug, and that's quite impressive, given the
proportions of the changes.

Best wishes.
Mario
-- 
http://parenteses.org/mario



reply via email to

[Prev in Thread] Current Thread [Next in Thread]