[Top][All Lists]

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

Re: [Chicken-users] Chicken C interface

From: Thomas Chust
Subject: Re: [Chicken-users] Chicken C interface
Date: Thu, 06 Jun 2013 12:23:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

On 2013-06-06 12:13, Kristian Lein-Mathisen wrote:
> [...]
> I didn't know foreign-lambda were the one that had to do
> the CPS-conversion. Does that mean there is a small performance overhead
> when using foreign-lambda as opposed to just foreign-primitive?
> [...]


the overhead is roughly one return instruction and one unconditional
branch instruction. I would assume that is negligible on a modern CPU.

At least, if you're worried about overhead in that order of magnitude,
you should probably write your code in hand-optimized assembler with the
CPU tuning manual on your lap, painstakingly tracking the state of your
processor's pipeline through your code and arranging the instructions to
never waste an idle cycle in any of the CPU subsystems, rather than
relying on one of those pesky compilers that do the wrong thing all the
time ;-)


When C++ is your hammer, every problem looks like your thumb.

reply via email to

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