[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shrinking the C core
From: |
Ihor Radchenko |
Subject: |
Re: Shrinking the C core |
Date: |
Sun, 20 Aug 2023 07:14:42 +0000 |
Emanuel Berg <incal@dataswamp.org> writes:
>> The discussion about floor started from Alfred using `floor'
>> as an example where CL uses system-dependent optimizations
>> and thus being much faster.
>
> So the answer to the question, Why is SBCL faster?
> is "optimizations". And the answer to the question, Why don't
> we have those optimizations? is "they are not portable"?
Looking at
https://github.com/sbcl/sbcl/blob/master/src/code/numbers.lisp#L390,
they employ certain x86-64-, x86-, ppc64-specific optimizations.
Althrough, Elisp's rounding_driver is not too bad actually. It also does
shortcuts depending on the argument type.
AFAIU, the main difference in SBCL vs. Elisp is that Elisp type checks
are often called repetitively on the same values. Even though the checks
are rather fast (typecheck is usually just a single xor + equal
operation), repetitive calls do add up.
And even this is not a definitive answer. I do not think that we can
point out a single reason why SBCL is faster. I am not even sure if SBCL
is _always_ faster.
> But isn't that what we do already with compilation and in
> particular native compilation, why can't that add
> optimizations for the native system?
If we talk about type checking, Elisp uses dynamic typing and
compilation cannot do much about it. Native compilation also does not
touch C subroutines - the place where typechecks are performed.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- Re: Shrinking the C core, (continued)
- Re: Shrinking the C core, Andreas Schwab, 2023/08/13
- Re: Shrinking the C core, Emanuel Berg, 2023/08/13
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/14
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/14
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/14
- Re: Shrinking the C core, Emanuel Berg, 2023/08/15
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/16
- Re: Shrinking the C core, Emanuel Berg, 2023/08/19
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Emanuel Berg, 2023/08/20
- Re: Shrinking the C core,
Ihor Radchenko <=
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core, Emanuel Berg, 2023/08/20
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Eli Zaretskii, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20