From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#42998: 27.1; gnutls-symmetric-encrypt slow when providing cipher as symbol Date: Mon, 24 Aug 2020 16:31:44 +0300 Message-ID: <835z986ugv.fsf@gnu.org> References: <20200823164330.GA72308@odonien.localdomain> <87y2m4ci5u.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34985"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mail@vasilij.de, 42998@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 24 15:33:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kACb4-0008z8-J8 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 15:33:14 +0200 Original-Received: from localhost ([::1]:50158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kACb3-0001n2-LT for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 09:33:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kACas-0001gB-HW for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 09:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45033) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kACas-0003R3-8C for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 09:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kACas-0003dq-4S for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 09:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Aug 2020 13:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42998 X-GNU-PR-Package: emacs Original-Received: via spool by 42998-submit@debbugs.gnu.org id=B42998.159827592412145 (code B ref 42998); Mon, 24 Aug 2020 13:33:02 +0000 Original-Received: (at 42998) by debbugs.gnu.org; 24 Aug 2020 13:32:04 +0000 Original-Received: from localhost ([127.0.0.1]:56579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kACZw-00039a-Jb for submit@debbugs.gnu.org; Mon, 24 Aug 2020 09:32:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kACZu-00033a-FS for 42998@debbugs.gnu.org; Mon, 24 Aug 2020 09:32:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44532) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kACZn-0003Iw-S3; Mon, 24 Aug 2020 09:31:55 -0400 Original-Received: from [176.228.60.248] (port=1284 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kACZm-0006RD-V1; Mon, 24 Aug 2020 09:31:55 -0400 In-Reply-To: <87y2m4ci5u.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 24 Aug 2020 15:01:01 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186141 Archived-At: > From: Lars Ingebrigtsen > Date: Mon, 24 Aug 2020 15:01:01 +0200 > Cc: 42998@debbugs.gnu.org > > Vasilij Schneidermann 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.