chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] Argvector handling - maybe we could do better at that


From: Jörg F . Wittenberger
Subject: [Chicken-hackers] Argvector handling - maybe we could do better at that
Date: Tue, 16 Feb 2016 19:34:20 +0100
User-agent: Mozilla/5.0 (X11; Linux armv7l; rv:38.0) Gecko/20100101 Icedove/38.4.0

Hi Folks,

I see a certain call pattern which I believe (as in "wild guess") could
be the cause of the strange 30% performance loss I observer for some
kind of load while I see an almost 50% performance gain for other jobs.

Looks like alternating calls procedures with many arguments (9 and 11 in
my case) are expensive.  Every second call will not reuse the argument
vector even though this would be easily possible.

If we would allocate argvectors to have at least a compile time defined
"reasonable" minimum room for X (say 32) words, then we could always
reuse the argvector if we neither need nor got more than X arguments
whenever the current code would try to reuse the argument vector simply
for being big enough.  Otherwise we would do what chicken does now:
allocate a fresh vector.

With the exception of constructors like vector, list, call/cc,
##sys#make-structure etc. most calls would end up reusing the very same
argvector.

Does this make sense?




There is another - independent - idea:


Why actually pass the argvector as a argument of every C call?  There
can be only one CHICKEN thread per process and I don't see this changing
any time soon.

So if we could convince the C compiler to pass the argvector - and as we
where about changing things the argument count too - in a global
*register* variable, then we needed zero allocation for most cps calls.


Still reasonable?


Cheers

/Jörg



reply via email to

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