From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23967: 25.1.50; Slow compilation of ns-win.el Date: Thu, 14 Jul 2016 17:54:23 +0300 Message-ID: <83inw88e3k.fsf@gnu.org> References: <83bn21a8q2.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1468508820 26723 80.91.229.3 (14 Jul 2016 15:07:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Jul 2016 15:07:00 +0000 (UTC) Cc: larsi@gnus.org, 23967@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 14 17:06:46 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bNiDt-0008Pm-Qb for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Jul 2016 17:06:45 +0200 Original-Received: from localhost ([::1]:54646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNiDs-000367-Tn for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Jul 2016 11:06:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNi2d-0005df-Gt for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2016 10:55:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNi2Y-0002RX-Qg for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2016 10:55:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNi2Y-0002RT-Mz for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2016 10:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bNi2Y-000339-I8 for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2016 10:55: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: Thu, 14 Jul 2016 14:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23967 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23967-submit@debbugs.gnu.org id=B23967.146850809811702 (code B ref 23967); Thu, 14 Jul 2016 14:55:02 +0000 Original-Received: (at 23967) by debbugs.gnu.org; 14 Jul 2016 14:54:58 +0000 Original-Received: from localhost ([127.0.0.1]:51558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNi2Q-00032U-Uf for submit@debbugs.gnu.org; Thu, 14 Jul 2016 10:54:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNi2L-000327-Hv for 23967@debbugs.gnu.org; Thu, 14 Jul 2016 10:54:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNi2C-0002O8-Ga for 23967@debbugs.gnu.org; Thu, 14 Jul 2016 10:54:44 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNi2C-0002Ng-DI; Thu, 14 Jul 2016 10:54:40 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1750 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bNi2A-0007fC-7Y; Thu, 14 Jul 2016 10:54:38 -0400 In-reply-to: (message from Noam Postavsky on Wed, 13 Jul 2016 17:15:15 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121066 Archived-At: > From: Noam Postavsky > Date: Wed, 13 Jul 2016 17:15:15 -0400 > Cc: Lars Ingebrigtsen , 23967@debbugs.gnu.org > > I ran the profiler on a compilation of ucs-normalize.el and found 2 > easy optimizations (ucs-normalize-block-compose-chars was using > with-temp-buffer in a loop, so I lifted the it out of the loop; using > regexp-opt-charset instead of regexp-opt saves some char-to-string > conversion, sorting, and duplicate deletion). The attached patch > brings the compilation down from 2.5 seconds to 0.8 seconds in my > normal running Emacs, and using the bootstrap-emacs command posted by > Lars (swapping ../lisp/international/ucs-normalize.el for > ../lisp/term/ns-win.el) from 1m30s to 7s. LGTM, thanks. However, I'm worried that we have no test for ucs-normalize, so it's hard to be sure the non-trivial functionality is unchanged, even though your changes are pretty straightforward. How about adding a test that uses the data in this file: http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt ucs-normalize claims to have passed an old version of this, but I see no existing way of re-running that test, did I miss something? I'd feel much safer if the tests all pass at least as they did with the old version. > Could we call `byte-compile' on the byte-compiler functions after loading them? Maybe, you will have to try. The bootstrap of the byte compiler is somewhat tricky, given all the dependencies (see COMPILE_FIRST in lisp/Makefile.in). Thanks.