From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: [andrew.maguire@ps.ge.com: RE: menu entries missing display of equivalent keyboard sequence] Date: Thu, 30 Jan 2003 10:21:28 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301301521.h0UFLSv20198@rum.cs.yale.edu> References: <200301160013.h0G0DHP11708@rum.cs.yale.edu> <200301282250.h0SMo7M11772@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1043940725 7676 80.91.224.249 (30 Jan 2003 15:32:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 30 Jan 2003 15:32:05 +0000 (UTC) Cc: Stefan Monnier Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18eGfW-0001yu-00 for ; Thu, 30 Jan 2003 16:31:58 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18eGlE-00044A-00 for ; Thu, 30 Jan 2003 16:37:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18eGeB-0002cQ-08 for emacs-devel@quimby.gnus.org; Thu, 30 Jan 2003 10:30:35 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18eGdG-0002SW-00 for emacs-devel@gnu.org; Thu, 30 Jan 2003 10:29:38 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18eGYr-0001Qj-00 for emacs-devel@gnu.org; Thu, 30 Jan 2003 10:25:07 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18eGVQ-0007pG-00; Thu, 30 Jan 2003 10:21:32 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id h0UFLSv20198; Thu, 30 Jan 2003 10:21:28 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman Original-cc: andrew.maguire@ps.ge.com Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11223 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11223 > - && !INTEGERP (Faref (this, make_number (0)))) > + && SYMBOLP (tem = Faref (this, make_number (0))) > + && !NILP (Fmemq (XCAR (parse_modifiers (tem)), Vmenu_events))) > > parse_modifiers is extremely expensive--it allocates space in caches. > Doing this for a lot of event types unnecessarily is a bad idea. My quick experiment indicates that the number of symbols whose cache is filled is increased by a bit more than 10% (from 618 to 689 in my test case, which was rather conservative). The experiment was to start Emacs, open an elisp buffer, a TeX buffer, a PCL-CVS buffer and a *vc-diff* buffer, open up a menu in each one of them (to cause the `where-is' thingy to happen) and then count the number of symbols that have the event-symbol-element-mask property set. > How many different non-integer prefix keys does parse_modifiers get > called for here? Maybe it is few enough that this is not a real > issue, but could you check? I don't know if 70 is few enough. Stefan