From: John ff <jpff@codemist.co.uk>
To: Andrea Corallo <acorallo@gnu.org>
Cc: "Óscar Fuentes" <ofv@wanadoo.es>,
emacs-devel@gnu.org, "Pip Cet" <pipcet@protonmail.com>
Subject: Re: Improving EQ
Date: Thu, 12 Dec 2024 18:10:12 +0000 [thread overview]
Message-ID: <51471937-8d56-4f72-8e80-2c6acd7eb892@codemist.co.uk> (raw)
In-Reply-To: <yp1ldwlch0j.fsf@fencepost.gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2352 bytes --]
-------- Original Message --------
From: Andrea Corallo <acorallo@gnu.org>
Sent: Thu Dec 12 10:50:04 GMT 2024
To: "Óscar Fuentes" <ofv@wanadoo.es>
Cc: emacs-devel@gnu.org, Pip Cet <pipcet@protonmail.com>
Subject: Re: Improving EQ
Óscar Fuentes <ofv@wanadoo.es> writes:
> Pip Cet via "Emacs development discussions." <emacs-devel@gnu.org>
> writes:
>
>> I looked at the "new" code generated for our EQ macro, and decided that
>> a fix was in order. I'm therefore sending a first proposal to explain
>> what I think should be done, and some numbers.
>>
>> This patch:
>> * moves the "slow path" of EQ into a NO_INLINE function
>> * exits early if the arguments to EQ are actually BASE_EQ
>> * returns quickly (after a single memory access which cannot be avoided
>> until we fix our tagging scheme to distinguish exotic objects from
>> ordinary ones) when symbols_with_pos_enabled isn't true.
>>
>> The effect on the code size of the stripped emacs binary is small, but
>> significant: 8906336 bytes instead of 8955488 bytes on this machine.
>> (The effect on the code size of the emacs binary with debugging
>> information is much larger, reducing it from 32182000 bytes to 31125832
>> bytes on this system.) There is no effect on the size of the .pdmp
>> file, which is expected.
>>
>> What's missing here is a benchmark, but unless there's a really nasty
>> surprise when that happens, I'm quite confident that we can improve the
>> code here.
>
> I've seen too many cases where *removing* instructions (mind you,
> literally removing, not changing!) made the code significantly slower.
>
> Modern CPUs are insanely complex and combined with compilers make
> intuition-based predictions even more futile.
That's why the patch needs to be benchmarked anyway.
> But reading your message makes me wonder if EQ and some other "simple"
> fundamental functions are not lowered by nativecomp? If not, maybe
> that's a significant opportunity for improvement.
Nativecomp only compiles eq for Lisp code, the one discussed here is the
eq used in C (and bytecode).
BTW ATM nativecomp generates code with the same layout of the eq we had
in C till my last change of few weeks ago. When eq will be stable in C
I guess I'll replicate the layout for generated code for Lisp as well.
Andrea
[-- Attachment #2: Type: text/html, Size: 3135 bytes --]
prev parent reply other threads:[~2024-12-12 18:10 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 22:37 Improving EQ Pip Cet via Emacs development discussions.
2024-12-12 6:36 ` Eli Zaretskii
2024-12-12 8:23 ` Andrea Corallo
2024-12-12 8:36 ` Pip Cet via Emacs development discussions.
2024-12-12 9:18 ` Eli Zaretskii
2024-12-12 9:35 ` Visuwesh
2024-12-12 10:40 ` Andrea Corallo
2024-12-12 17:46 ` Pip Cet via Emacs development discussions.
2024-12-12 19:09 ` Eli Zaretskii
2024-12-12 10:53 ` New "make benchmark" target Stefan Kangas
2024-12-12 10:59 ` Andrea Corallo
2024-12-12 16:53 ` Pip Cet via Emacs development discussions.
2024-12-13 0:49 ` Stefan Kangas
2024-12-13 7:37 ` Andrea Corallo
2024-12-14 12:00 ` Stefan Kangas
2024-12-14 14:06 ` Stefan Monnier
2024-12-14 11:34 ` Pip Cet via Emacs development discussions.
2024-12-14 11:58 ` Stefan Kangas
2024-12-14 20:07 ` Pip Cet via Emacs development discussions.
2024-12-14 20:20 ` João Távora
2024-12-15 0:57 ` Stefan Kangas
2024-12-22 16:04 ` Pip Cet via Emacs development discussions.
2024-12-15 0:58 ` Stefan Kangas
2024-12-12 10:42 ` Improving EQ Óscar Fuentes
2024-12-12 10:50 ` Andrea Corallo
2024-12-12 11:21 ` Óscar Fuentes
2024-12-13 12:24 ` Pip Cet via Emacs development discussions.
2024-12-12 17:05 ` Pip Cet via Emacs development discussions.
2024-12-12 18:10 ` John ff [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51471937-8d56-4f72-8e80-2c6acd7eb892@codemist.co.uk \
--to=jpff@codemist.co.uk \
--cc=acorallo@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=ofv@wanadoo.es \
--cc=pipcet@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.