[Top][All Lists]

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

Re: Tooltips GC overhead

From: Nix
Subject: Re: Tooltips GC overhead
Date: Sat, 08 Aug 2015 14:41:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

On 4 Aug 2015, Stefan Monnier told this:

>>> The problem is that it would slow down functions like `cons'.
>> I don't see why it has to.
> I don't see how it wouldn't have to ;-)
>> And we could do that only when the memory profiler is invoked.
> AFAICT it would require an extra test somewhere in Fcons, and that
> test will always have to be performed.

The cost you're trying to defend against here is a mispredicted branch
and corresponding pipeline stall, so if you mark it with
__builtin_expect() (or analogue in other compilers) you can make the
'profiler off' case the predicted branch, and its cost when off should
drop to nearly zero.

(Or so it seems to me.)

NULL && (void)

reply via email to

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