From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Thomas Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Improve Malayalam language transliteration Date: Thu, 16 Jul 2020 09:07:30 +0530 Message-ID: <87v9io9ll1.fsf@Kittu.i-did-not-set--mail-host-address--so-tickle-me> References: <87d07ul5m1.fsf@gmx.net> <83r1wa5k1w.fsf@gnu.org> <87tv161aml.fsf@gmx.net> <83eesa5fxi.fsf@gnu.org> <87zhaxk5tw.fsf@gmx.net> <83wo4wq81f.fsf@gnu.org> <87365t9dwp.fsf@Kittu.i-did-not-set--mail-host-address--so-tickle-me> <83tuy8lulp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25637"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 16 05:40:15 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jvukp-0006Yo-8F for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Jul 2020 05:40:15 +0200 Original-Received: from localhost ([::1]:47774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvuko-0007aN-3m for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Jul 2020 23:40:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvuiK-0006pn-J6 for emacs-devel@gnu.org; Wed, 15 Jul 2020 23:37:40 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:54477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvuiI-00041g-PY; Wed, 15 Jul 2020 23:37:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1594870656; bh=kWK8oz16l6KrILPz2L2/2qBrqggTBXlqW+BYl4zRtBI=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=KYTreE8m2NMqvViX6JTX+GzOtfEySDqz2BTas9mkaA/RDfQKXKLA/WBZvdkLf6Lsz belWMSOjxS5BxRZgzMXOmSLnAI+gk7ZVY3U5E4gmv8D6uzuvCTdxFosyC39NzpsaNx gMkHC54qADQ2ZvAgiHnipkgCxhkDsytrxs0Byklg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from localhost ([59.94.237.62]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MOREc-1kE0Jt1vlW-00PqlV; Thu, 16 Jul 2020 05:37:36 +0200 In-Reply-To: <83tuy8lulp.fsf@gnu.org> X-Provags-ID: V03:K1:Fom7HdeIyFMjw+/MjZgWrZxU212jOLULwc0oeBNytC/kILcn/ZP hdW8w3yZUUAHCkhN5jDnwrKvmLDfTnj/VpXo6liq3w0i/Ot6VkeAOsWR0AS2AUb0JXYEq3L 8h18s03JckwPQEdtypcqG2iy9ITEvZiWAx9gluxe6Lr3Et0zOY5x2A7xyrh9HjadAWJlFXE QgQEQoHr/4/U3EP+39leg== X-UI-Out-Filterresults: notjunk:1;V03:K0:iRTDtkf3Zxk=:owUiIONAVqUunsJSnJXnoA dbHx5SNFUJWjNRNHFcDYNjd6wvbgNGN0/PcjfgJKN+U6ChvZh6HcYLWSTl4+WY4KSczVZZvik aYHYKQJj3an6iCkJWpBlW7zULfMnNJr9bL/pt2uepo5rA3rjn9Z4J2wQupe6yFuchUtlgCle9 z4qpZARmOeqaANjLrc4F4ZN6Q9kZZgEOBp1jZVEDN4mEBFqr1/QTlqMiesxqoU8BfivRdsgQN pGjGqOrZyD0718AmxvCh55Ra8rMls3HSfYu7XLocQ5EDAph6rZPHj4zjd+ZRmqs9caUz6LSpC WVpr/IkC8w8GZBgX3IlCVdVuYLbS+Jw6o0vAo0HyySS431994OS7QRGxzTR6KHLaeNSga1Esr JtGCa7VJnl2XqVYNZt//IY0e+QsjHI6PgbnE9wVHvfMhf7cbG4sIOgbHf/2e5yW9d4x9jyBZY 9cxyyH1Ng6mzH1kvwvKbj1q6GETqiO+7K8rmBf6bGqJmWIWSKHAEB6+UiOQAaeBBiQZQFBOpu NUSK1jxPqk8QiV7uGDyVNuzV3B7yCio6KpLwM0et0rl0eCTmriiGDesatUjbUSz6nmCw0MrSJ gb8E3EihaG6JMEwBrXjxmAWzlllbSOpPZods6yUvVQtu1DXP8pB00ScnUzveCrEHncKbo1llb LgYArY6l2s9TjXz/1qLGXeT16zn85mfEPA/oHm4TmODHcDJ0Wg7jV0+NmZh0LKMzSmlozIFhj YucS0bdqz7AYCgs+h7orwb+/07GRFjhv1JkIW/mCBvB0poTN0cOMjV2rX+sNZyUAoZrbnFIw Received-SPF: pass client-ip=212.227.17.20; envelope-from=jimjoe@gmx.net; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/15 23:37:36 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252974 Archived-At: Eli Zaretskii writes: > Why do you think lists are more expensive than strings in this case. These are constants in the code, and I reasoned that a (contiguous) string representation would use less memory and be easier to lookup. The only reason I didn't think of this at first was that char-tables in indian.el & ind-util.el used lists rather than vectors, but I don't know why, honestly. > Did you have a chance to measure the performance and saw a significant > difference? I have done it now by running this 5 times in succession: ./emacs -Q --batch --eval '(progn (set-input-method "malayalam-mozhi") (me= ssage "%s %s" (benchmark-run 1000 (self-insert-command ?U) (self-insert-co= mmand ?L)) (memory-use-counts)))' For benchmark-run: Before: (0.0038055209999999996 0 0.0) (0.0037328350000000003 0 0.0) (0.003799021 0 0.0) (0.0038411929999999997 0 0.0) (0.003767182 0 0.0) After: (0.00391531 0 0.0) (0.003733149 0 0.0) (0.0037935509999999996 0 0.0) (0.003811992 0 0.0) (0.0038083170000000003 0 0.0) Seems to be either no improvement or a slight degradation in timings... For memory-use-counts: Before: (2237361 649 4075372 17010 1612818 4995 86731) After: (2237339 649 4075373 17010 1612855 4995 86734) Note the difference in conses (1st item), vector cells (3rd), string-chars (5th) and strings (last). Accounting for their unit sizes the benefit is: (2237361-2237339)*16+(4075372-4075373)*16+(1612818-1612855)*1+(86731-86734= )*32 =3D203 bytes Not sure if this is significant. I'll defer to your judgement...