From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.devel Subject: Re: Loading souce Elisp faster Date: Tue, 26 Feb 2013 23:51:45 +0100 Message-ID: <878v6a4rjy.fsf@engster.org> References: <87hal05omn.fsf@engster.org> <87wqtv3utc.fsf@engster.org> <87liaa4wp9.fsf@engster.org> <831uc2ye2q.fsf@gnu.org> <87haky4vvg.fsf@engster.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361919112 14246 80.91.229.3 (26 Feb 2013 22:51:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Feb 2013 22:51:52 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 26 23:52:15 2013 Return-path: Envelope-to: ged-emacs-devel@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 1UATNe-0006Kh-P9 for ged-emacs-devel@m.gmane.org; Tue, 26 Feb 2013 23:52:14 +0100 Original-Received: from localhost ([::1]:35812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UATNK-0003zV-1l for ged-emacs-devel@m.gmane.org; Tue, 26 Feb 2013 17:51:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UATNG-0003z1-Hc for emacs-devel@gnu.org; Tue, 26 Feb 2013 17:51:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UATNE-00061k-S2 for emacs-devel@gnu.org; Tue, 26 Feb 2013 17:51:50 -0500 Original-Received: from randomsample.de ([83.169.19.17]:36251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UATNE-00061K-EN; Tue, 26 Feb 2013 17:51:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=tFqr9iaWxBDxSafqPhfzhFJeLCvKXTS1vfWscG1d2iI=; b=Yfn0kVSQVcDuvi+3IwMglFSsHNn2tbdsLG51MBag9ROxjeDaUl+ni+s7bbj0WMFo5cxxc1BI6kV7z+rREidtOkbIUVYrLerRPN0WInOJIPBnYmRyD438pmJLQ2sdW8zy; Original-Received: from dslc-082-083-063-126.pools.arcor-ip.net ([82.83.63.126] helo=spaten) by randomsample.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UATNC-0001Kg-Aa; Tue, 26 Feb 2013 23:51:46 +0100 In-Reply-To: <87haky4vvg.fsf@engster.org> (David Engster's message of "Tue, 26 Feb 2013 22:18:27 +0100") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.93 (gnu/linux) Mail-Followup-To: Eli Zaretskii , rms@gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 83.169.19.17 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157409 Archived-At: David Engster writes: > Eli Zaretskii writes: >>> From: David Engster >>> Date: Tue, 26 Feb 2013 22:00:34 +0100 >>> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > >> >>> >>> I actually tried that, but it took *longer* with the "coding: utf-8;" >>> comment, which is why I thought that this is apparently not working and >>> some additional changes are needed first. >>> >>> Here's what I tried: I took files.el from emacs/lisp and copied it to >>> files_utf8.el and added the "coding" comment there. Then I used this: >>> >>> (setq filename "~/files_utf8.el") >>> (setq final 0) >>> (dotimes (i 1000) >>> (let ((res >>> (benchmark-run (find-file filename)))) >>> (setq final (+ final (car res))) >>> (kill-buffer (find-buffer-visiting filename)))) >>> (message "Result: %f" final) >>> >>> Without the coding-comment, this takes ~7.5s, but *with* the >>> coding-comment it takes ~9.5s. >> >> Try "coding: utf-8-unix;" instead. > > This only reduces the time a tiny bit (could well be within > variance). It's still almost 2s slower. > > Maybe I'm doing something stupid. I'd feel more comfortable if someone > else could confirm this. Well, it seems this happens because files.el is not UTF-8 encoded but plain ASCII. If I put some multibyte characters in it and save it as UTF-8, loading it becomes slower: it then takes ~12 seconds. If I put in the magic utf8-comment, it stays at ~9.5s. So unless I made some mistake, it seems that putting a "coding: utf-8" comment into an actual UTF-8 encoded file speeds up loading, while putting it in a plain ASCII file slows it down, both by about 20% resp. -David