Subject: bug#62009: 29.0.60; Emacs crashes on setf symbol-name

From: Eli Zaretskii <[email-masked]>
Date: Fri, 10 Mar 2023 13:59:28 +0200

> Date: Fri, 10 Mar 2023 10:59:03 +0000
> From: Gregory Heytings <[email-masked]>
> cc: Eli Zaretskii <[email-masked]>, Philip Kaludercic <[email-masked]>, 
>     [email-masked], [email-masked], [email-masked], 
>     Augusto Stoffel <[email-masked]>
> 
> > Creating a string is not a good idea since it will lead to an 
> > unacceptably large performance overhead.
> 
> Is "symbol-name" a function that is used in performance-critical code? 

Yes, it is.  Just grep for it.  We even call it from C quite a few
times.  And processing is just one aspect of that; memory and GC is
another, not less important.

> And did you actually measure that performance overhead before concluding 
> that it it "unacceptably large"?

Anything greater than zero is unacceptably large from where I stand,
when the other side of the balance is the use case against which this
protects.

> > Raising an exception upon modification would be the best approach.
> 
> That would also come with a performance overhead, as there is currently no 
> way to distinguist strings that are used for symbol names from other 
> strings.  Not to mention the added complexity in the code.

Which is why we should do neither.