Subject: Re: bug#42998: 27.1; gnutls-symmetric-encrypt slow when providing cipher as symbol

From: Eli Zaretskii <[email-masked]>
Date: Mon, 24 Aug 2020 16:31:44 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Mon, 24 Aug 2020 15:01:01 +0200
> Cc: [email-masked]
> 
> Vasilij Schneidermann <[email-masked]> writes:
> 
> > I'd consider either to
> > document this behavior or making the mapping more efficient, for example
> > by caching the cipher list instead of recomputing it over and over
> > again.
> 
> The following fixes the problem, but I'm not quite sure whether it's
> correct...  Is initialising a Lisp_Object to NULL something that's
> allowed over all platforms?

Since Lisp_Object is not really a pointer, at least not in all builds,
this might work, but is fragile, and thus not recommended.

> I can't initialise it to the more natural Qnil, since that's not a
> constant, C-wise.

Such initializations shall be done in the syms_of_* functions, in this
case syms_of_gnutls -- those run at build time, and are recorded in
the dumped memory.  yes, that means the static variable will not be
private to the function, but I don't think it's a problem.  I think
it'd also allow you to staticpro the variable only once.

Thanks.