From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#36597: 27.0.50; rehash hash tables eagerly in pdumper Date: Sun, 14 Jul 2019 16:54:52 +0000 Message-ID: References: <6a260307-a463-bd08-8a10-d7664d0606a2@cs.ucla.edu> <74235afc-7043-1da7-7c71-07f0ca23b9fd@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="49678"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36597@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 14 18:56:07 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmhnD-000CoG-MN for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 18:56:07 +0200 Original-Received: from localhost ([::1]:33348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmhnC-0007ep-N3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 12:56:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57001) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmhn9-0007eX-8t for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 12:56:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmhn8-0004B9-4h for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 12:56:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36949) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmhn7-00049R-Rr for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 12:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmhn7-0000PV-PG for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 12:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2019 16:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36597 X-GNU-PR-Package: emacs Original-Received: via spool by 36597-submit@debbugs.gnu.org id=B36597.15631233361527 (code B ref 36597); Sun, 14 Jul 2019 16:56:01 +0000 Original-Received: (at 36597) by debbugs.gnu.org; 14 Jul 2019 16:55:36 +0000 Original-Received: from localhost ([127.0.0.1]:45770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmhmi-0000OZ-11 for submit@debbugs.gnu.org; Sun, 14 Jul 2019 12:55:36 -0400 Original-Received: from mail-ot1-f44.google.com ([209.85.210.44]:32861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmhmg-0000OH-0i for 36597@debbugs.gnu.org; Sun, 14 Jul 2019 12:55:34 -0400 Original-Received: by mail-ot1-f44.google.com with SMTP id q20so14448509otl.0 for <36597@debbugs.gnu.org>; Sun, 14 Jul 2019 09:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=cCPzDfIu142p6zzgvxF0VZKO0dcki4OmxduPw9IHXmY=; b=tIhJQv736XL8oCr2Nm/m/znb9OVuMFLOYz2xfjJwtrNqQlisyqoXTPIzwOrZdOoBjp JGc0q6psbIEDqdUAg9HGJNsNiVhmbkRVrVXDsM+6jCC0ROYzVXztyuubS/RXB0kUhWlE AjECuTrbBVIjC7YBYiP6EaPDvgKHzAylkOVvfWO9MFf+7yqmYfHVjLx1NCXMZfDXvEXe CR/l1Vc0CsJ23Znu19Y1EusA6aaMW4QKqb8zDgV5b1Z8O4dmhQalWNb0UI7H9omnj+FD lCoCDF6wnhEvMa/O2fAsf2PlZC0GLcpudhuAeT+Bk7Rj2HR5G+3yPhDZQV/sQj5jmq7O qPLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=cCPzDfIu142p6zzgvxF0VZKO0dcki4OmxduPw9IHXmY=; b=CBPkP/HVgzIgHbyojvcFRZXVCreC47+RXnaFALA6mtKoA3B26Rb3nYz/qqaocuZZvp klndy9EbOw9OB7feB6iCtwkOcKNL/1QwBowP4rTJv7bhMqniIyXfTM/1N9sRfiD1mf8f 5f53R6n+9yRDs5l3xetYFpStItCLOBerZvjFbgYUhLuHZi82PR/EpQpYFjp4SW4MBFLA olIKZCGum/38hT8TX1bNaKcymNPzzJrFFR401+rDYQH7mnH5LEy9e3nPCHjOVQaqjWeR +nntYVIN94hMNcWu2tyCfXHl/2x5SmeZUVIGj4dYPhzWC+RQvCWtK8fsTQsT4Es+inSu 1G7g== X-Gm-Message-State: APjAAAX6sf0S3bfHFnQpLKUc8rYSC4JnfKBA26iT5F/jhiUTZfZs5aOO 5FvZ+FwiZ5rM2R0Na3xj4hX27lHl1AwoFep582E= X-Google-Smtp-Source: APXvYqyMnwmQaBB6keH+7N6GoTYPAP1AV05z18cHWSyvd3I7LlyyF684J1qCYWRK83aQToRcn8gelB+c+gxZuZmFgNA= X-Received: by 2002:a9d:7352:: with SMTP id l18mr12001687otk.292.1563123328338; Sun, 14 Jul 2019 09:55:28 -0700 (PDT) In-Reply-To: <74235afc-7043-1da7-7c71-07f0ca23b9fd@cs.ucla.edu> 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: 209.51.188.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:163012 Archived-At: On Sun, Jul 14, 2019 at 3:49 PM Paul Eggert wrote: > Pip Cet wrote: > > Indeed, that's plenty of small Emacs processes not doing very much. > > It's not the case we ought to be optimizing for, I think, but the > > performance concerns should be taken seriously. > > What's a good benchmark for what we should be optimizing for? Ideally som= ething > somewhat-realistic as opposed to a microbenchmark. I'd suggest something along the lines of: perf stat -r 10 --table -e cycles:u,instructions:u,branches:u,branch-misses:u make -B ../lisp/leim/ja-dic/ja-dic.el With my patch: 61,136,837,192 cycles:u ( +- 0.42% ) 42,313,912,525 instructions:u # 0.69 insn per cycle ( +- 0.00% ) 12,131,893,779 branches:u ( +- 0.00% ) 47,602,747 branch-misses:u # 0.39% of all branches ( +- 1.11% ) without my patch: 61,460,927,899 cycles:u ( +- 0.44% ) 42,358,289,131 instructions:u # 0.69 insn per cycle ( +- 0.00% ) 12,134,582,441 branches:u ( +- 0.00% ) 48,540,232 branch-misses:u # 0.40% of all branches ( +- 1.09% ) A 0.5% improvement. By comparison, perf stat -r 100 --table -e cycles:u,instructions:u,branches:u,branch-misses:u ~/git/emacs/src/emacs -Q --batch With my patch: 80,749,425 cycles:u ( +- 0.81% ) 146,770,045 instructions:u # 1.82 insn per cycle ( +- 0.00% ) 29,218,226 branches:u ( +- 0.00% ) 450,275 branch-misses:u # 1.54% of all branches ( +- 0.11% ) without my patch: 78,896,395 cycles:u ( +- 0.12% ) 147,059,777 instructions:u # 1.86 insn per cycle ( +- 0.00% ) 29,287,917 branches:u ( +- 0.00% ) 450,194 branch-misses:u # 1.54% of all branches ( +- 0.09% ) About a 2% slowdown. perf stat -r cycles:u,instructions:u,branches:u,missed-branches:u > is dominated by a single CPU-intensive Emacs process and takes about 19 C= PU > seconds on my home desktop. The proposed patch slows this benchmark down = by > about 0.6%. (I ran the benchmark ten times after a warmup run, and took t= he > average of the ten user+system times.) Hmm. I'd like to know the reason for that, but I suspect it may simply be thermal throttling. That's the reason I'm running tests in parallel, though it might be better to compare instruction counts or scheduled =C2=B5-ops rather than cycles...