From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: On elisp running native Date: Tue, 10 Mar 2020 17:46:12 +0000 Message-ID: References: <87eeu5txxw.wl-all_but_last@163.com> <8736agmbir.wl-all_but_last@163.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="31901"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: emacs-devel@gnu.org To: Zhu Zihao Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 10 18:47:08 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 1jBiyC-00088o-DC for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 18:47:08 +0100 Original-Received: from localhost ([::1]:37826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBiyB-0007E7-F2 for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 13:47:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55544) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBixW-0006Om-HD for emacs-devel@gnu.org; Tue, 10 Mar 2020 13:46:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBixV-0007A6-5b for emacs-devel@gnu.org; Tue, 10 Mar 2020 13:46:26 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:54130) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jBixU-000749-O6 for emacs-devel@gnu.org; Tue, 10 Mar 2020 13:46:24 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 02AHkD3m008401 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 10 Mar 2020 17:46:14 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 02AHkCDR003440; Tue, 10 Mar 2020 17:46:12 GMT In-Reply-To: <8736agmbir.wl-all_but_last@163.com> (Zhu Zihao's message of "Wed, 11 Mar 2020 00:15:40 +0800") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 205.166.94.20 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:245436 Archived-At: Zhu Zihao writes: > I' ve read some code of your benchmark. And there's a simple way to optimize > these bench programs a littel bit. > > For some program use cl-defstruct, you can put `(cl-declaim (optimize (speed > 3)))` in the file. This instructment will tell Emacs byte-compiler to delete > runtime type check code (which is harmful in bench game) in struct accessor. > > An example is > https://gitlab.com/koral/elisp-benchmarks/-/blob/master/benchmarks/nbody.el. > > After adding instructment and byte-compilation, the bench result is > > (benchmark-run (elb-nbody-entry)) > ;; => (28.996680579 107 15.392465563000002) > > 28s was taken in 1000000 times iteration. And I believe native-comp will get > better result. Hi Zhu Zihao, yes there are a lot of ways these benchmarks could be optimized but IMO these are to have a (as much avg as possible) case to optimize for. We have taken some of them from the bench game just to have a starting point but we haven't spent any time to optimize them on purpose. Perhaps the day we'll want to compare our implementation against others we'll work on some optimized entry for the bench game. Thanks! Andrea -- akrl@sdf.org