From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Simon Leinen Newsgroups: gmane.emacs.devel Subject: Re: Skipping unexec via a big .elc file Date: Sun, 30 Oct 2016 16:31:27 +0100 Message-ID: References: <83h98nidvd.fsf@gnu.org> <87eg3rvtsf.fsf@users.sourceforge.net> <83k2dihpm9.fsf@gnu.org> <8760p2wzgj.fsf@users.sourceforge.net> <838ttyhhzu.fsf@gnu.org> <871szqwu51.fsf@users.sourceforge.net> <831szqhbc2.fsf@gnu.org> <87d1itt79z.fsf_-_@users.sourceforge.net> <7baa18d4-2b09-caa8-005e-29008a383ad1@cs.ucla.edu> <83mvhwrgd5.fsf@gnu.org> <8539f38f-9a11-44c3-4de7-bb974c96206c@cs.ucla.edu> <8360ojpndr.fsf@gnu.org> <83shrnm0k1.fsf@gnu.org> <075B0922-F07A-4FBA-AE71-027E964A5ED4@raeburn.org> <54AAC13A-CF56-4393-A932-DC6CBBF51259@raeburn.org> <3CC6BB36-1794-4202-8243-132E0345B236@raeburn.org> <52BDCC33-546C-4F47-A230-00EBC813B038@raeburn.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1477841530 32719 195.159.176.226 (30 Oct 2016 15:32:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2016 15:32:10 +0000 (UTC) Cc: Eli Zaretskii , Stefan Monnier , Emacs developers To: Ken Raeburn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 30 16:32:06 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0s5R-0006Tv-1P for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2016 16:31:53 +0100 Original-Received: from localhost ([::1]:58902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0s5T-0007kY-Oa for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2016 11:31:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0s5K-0007j3-Rg for emacs-devel@gnu.org; Sun, 30 Oct 2016 11:31:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0s5K-0008Am-3v for emacs-devel@gnu.org; Sun, 30 Oct 2016 11:31:46 -0400 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:35062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c0s5I-0008AD-HM; Sun, 30 Oct 2016 11:31:44 -0400 Original-Received: by mail-wm0-x22a.google.com with SMTP id e69so195266024wmg.0; Sun, 30 Oct 2016 08:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=E7SgRsU1SH0aw8kRz7zjervbmp5aItaYu72zooRyt5M=; b=Mo+DOQBMAqHdKhhR91xCYWTH6ogSISJtFX0ehznAV5oA65sVxXHHHjWpMVTFgzL6up YaXlUGfPKrEJqt3NLR+PncVRkIL03fWrVo4l5sTP3NnKoSrOJdsGthwx6oG88aylkJj+ 6waC2a5S+AsNOTVNlqyjm/CHO/tJZKffWPrVIsLY2KJypahMj4NwDaBZLrWCj/wCHpWG wa2A0JLu9x25HuU8B+fCTiNvV8zG7l7Ut0JkcK1zTIYtUKhQRhOzetPjqhutLMTMy8RL kGicj3OfgQLnLQO0T2J77DfnfgMOajtU87IHUtxNgpBq3NO5rXPL9yA6RO1Xj4Y0C1s5 6hRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=E7SgRsU1SH0aw8kRz7zjervbmp5aItaYu72zooRyt5M=; b=O3/0BjwOqY8bFMnrycsTLw1FQbAszhR0uHr9g0OmMFPvLhB2AgdTIXcTfFs+rxV3DQ qQr5if+Y6z4G3CHuPm2JtrLch+003cQJ4oFhzt3y15FFsa88ziXpGXtBS6qnK1zgKJly xA+MBKiZeRyjsfHxhf/9ygfBQV0jfSP3Ud2ht2I0Nn7YmjhpZbEqafxWWgQU9O9SgqMX BvLgW+L05DF6R56qn5gWXPllhHJnt/vC9RxtQ6XPksD2wh0xqhrrtslDCq3TFIABbuN/ b5wu7re4BS0mRyychmXXRBiUDkjA98vQg47wO0NboMJFduuAsidznGOdFytJA4e1Vu9L PKNg== X-Gm-Message-State: ABUngvdYAeYaDC4OWuPNWCilogNj0MuELh9fjkqxrwSX6skUOgtTfusN1WbWmE83JyV/Dxs85zd6jjxnyMRptQ== X-Received: by 10.194.172.100 with SMTP id bb4mr1935639wjc.53.1477841503027; Sun, 30 Oct 2016 08:31:43 -0700 (PDT) Original-Received: by 10.80.186.163 with HTTP; Sun, 30 Oct 2016 08:31:27 -0700 (PDT) In-Reply-To: <52BDCC33-546C-4F47-A230-00EBC813B038@raeburn.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:208989 Archived-At: On Sun, Oct 30, 2016 at 3:43 PM, Ken Raeburn wrote: > I switched over to a pair of hash tables and the run time is just under 0= .2s on my test machine now. Profiling reports are now topped by read1, rea= dchar, and readbyte_from_file (now including the expanded getc_unlocked cal= ls), accounting for about 30% of the CPU time between them. The hash funct= ions and substitute_object_recurse are not taking a significant amount of t= ime. [...] Promising! Years ago I spent some time optimizing the MIB-reading code in UCD/Net-SNMP, and found that the biggest win was to treat the input file as one big buffer (I actually mmap()ped it) and then avoid most of the memory allocation overhead of token creation by using start/end pointers directly into that buffer. I never upstreamed that code, and I'm not sure the representation would have been acceptable to the other developers. But it sure was fast. Maybe an approach like that would be suitable for .elc loading. --=20 Simon.