From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.bugs Subject: bug#50777: Dropping EIEIO from xref (for performance) Date: Fri, 24 Sep 2021 17:12:46 +0200 Message-ID: References: <6b5b14d5-b2ca-8add-f4bf-a3405270c07a@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13470"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 50777@debbugs.gnu.org, Stefan Monnier , Daniel =?UTF-8?Q?Mart=C3=ADn?= To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 24 17:13:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mTmsx-0003Fv-SZ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Sep 2021 17:13:12 +0200 Original-Received: from localhost ([::1]:33668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTmsw-0003Bw-LP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Sep 2021 11:13:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTmso-0003BM-Nm for bug-gnu-emacs@gnu.org; Fri, 24 Sep 2021 11:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mTmsn-0007in-V9 for bug-gnu-emacs@gnu.org; Fri, 24 Sep 2021 11:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mTmsn-0002Xz-QK for bug-gnu-emacs@gnu.org; Fri, 24 Sep 2021 11:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Arthur Miller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Sep 2021 15:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50777 X-GNU-PR-Package: emacs Original-Received: via spool by 50777-submit@debbugs.gnu.org id=B50777.16324963779779 (code B ref 50777); Fri, 24 Sep 2021 15:13:01 +0000 Original-Received: (at 50777) by debbugs.gnu.org; 24 Sep 2021 15:12:57 +0000 Original-Received: from localhost ([127.0.0.1]:59040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTmsi-0002Xd-QY for submit@debbugs.gnu.org; Fri, 24 Sep 2021 11:12:57 -0400 Original-Received: from mail-oln040092071079.outbound.protection.outlook.com ([40.92.71.79]:5540 helo=EUR03-DB5-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTmsg-0002XJ-An for 50777@debbugs.gnu.org; Fri, 24 Sep 2021 11:12:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YpeFwVJ1wBzhnSzP8KHiDexCYxr83nLHrrlyS7n4AiZPwD/nnnvBoNvCISxNYkfM+GyuzwpcZ0b05lQovz/f4QFJbGWnLEGl9JWMuAHw7YQRLjcLWELpQVqWODeXVR8OD+G1XuQnaBNir7nAcjTnd1C8bbI3IN5g8tGMvqVZwsYb4bkwDGW22AY2PDgEhbO0kNMDeGsHQZ6OO6AMiuHbrU57vmUxsdcYBLwOSCCLAtC3AuCX7DQTEDRh2lbCP6dpzeEJQMnv5l/pxbVG70AD/aEmKH75JKxLzmSquD22C/gpRUWVfcbH3zgKCDI6IAktibB85KIj268T1tHM1gqJCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UGe8Py7mBFvztrzM3RedlRP9I5meWTRZgo8eWmoJdR8=; b=Is0/UBBWBg5UDN87X2gGB5NnDymSViwxXop5IGS9BDLUTw6mJPa+LiaXqJfU5YrxFdMKB+gYMTe8QLMfi6cWtabMAeYz04lEpR0+z1UlmmoXDy2hvFG1+P9wMHTb6WDZwKJg/2jaVpVkJCJjL2T/xh7SwiQ4mpaT7m6+UoxjRTBn/N7mFR2DiyTrPINW2SwgJxseGohYGIslJEdXZk2uS5zwxbm2AWhtS9hiHiNcSkV/ySdyf7Ha7ICLWH8gPhvzYudakouMvRWbuBe3LgouzyR96NtNxgur28Lds2Vw822tdqe/lNTXWBpQR3Ej1cTtY9BGiOAwtbapuhLDaKN7wA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UGe8Py7mBFvztrzM3RedlRP9I5meWTRZgo8eWmoJdR8=; b=DkcokgehbopffZ0vrTkLQ02pqtV2m/xNwA3DcADqhWkRCfkEGrr8ZpyxLJ74BtPpqihTrfYeQ+PeQOhiPU6Yk8PctOWHm9dOiWG/KKosVm7uCSefEEnWRd5rO43HyvOZnXsIQA8hFbKhrJ1CpmkgS+toRJT5yL59nqxgoI6CWN9TdxxYoFhgjR+f/YZdZBA2YDd++vWjZ/J2JpAiMaPVL/CkcXdWs7fwILHR9bhyML7KYePY8GlEuRv4irw1p/WHcW5pHs+yVSscB/0unJe4RWC/CvttnWJrc81If60rSN1+w5HE4PMtAVkpCSzUhlgNGcf1IauVV4QkX1S2JkZFxg== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM9PR09MB4740.eurprd09.prod.outlook.com (2603:10a6:20b:286::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Fri, 24 Sep 2021 15:12:48 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc%9]) with mapi id 15.20.4544.018; Fri, 24 Sep 2021 15:12:48 +0000 In-Reply-To: (Dmitry Gutov's message of "Fri, 24 Sep 2021 16:37:25 +0300") X-TMN: [237wEClieCwrl8QNb4np7G92NG9M7Gop] X-ClientProxiedBy: HE1PR0402CA0028.eurprd04.prod.outlook.com (2603:10a6:7:7c::17) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87o88ic8i9.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by HE1PR0402CA0028.eurprd04.prod.outlook.com (2603:10a6:7:7c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Fri, 24 Sep 2021 15:12:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df84bea4-a7e2-46ff-c303-08d97f6dc493 X-MS-TrafficTypeDiagnostic: AM9PR09MB4740: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i+4+EEGANeSDwEDCnEZnduL2h0k4FZLcxZq0Mr4xTW4nuId1VoQhhUOZFyeO2AlI/IMfiiVYpJ9pvonbHPCV7Gbs+kUQtvUbyOeod1fOMN4HyH074jSbEUIYudbcunK6ltM2qlyzrxXdwR52YlmYuoK/RbGzeUbdG8hVGntVDUfQycHGVbB/qqZOvDBcieWfedu2fcMIyIU05K/GMPnP6FymBVNT9njaoNp5OVVeTSVm+Vp13bupD+rmXtoC5qE1+XMy5R+XUMyKg1bOx8x8HL0JYFszXu806Eo+enOe6eWH/B6Nh+chYrVvPsh5gC9GnTj8SV/24yl2z88uNm22zMkkzJ8awB6EQWpgieluahGHJ2eW/Ste6O7SiflE1YHXk1ZBSc6uiL+izwxhiFKKBBgATMwcFJkXT/4pR09Oajc0yM5wVGw4wNUfC3G8GUO2 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: c3jtJF1nXeSJz0d3gy/uplqk5jkSNKg1yYASuk7BDLLulnTYtnJlAxsCg+su59CWcQH3TqaFRDyfqtcKqspnfMorV9sxZK5awcwMu7ImUE0lil4HGsCgzA9wmQ8xvM6lzTRhLNdqSYHnyE81XJXG3Q== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: df84bea4-a7e2-46ff-c303-08d97f6dc493 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2021 15:12:48.1442 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR09MB4740 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:215315 Archived-At: Dmitry Gutov writes: > Resending with the intended recipients (except for the maintainers who are > automatically subscribed anyway, to spare the inboxes). > > With the recent discussion about our Lisp overhead when the search returns many > matches, I went a couple more rounds to try to identify the hotspots. > > My main benchmark for that is > > (benchmark 1 '(project-find-regexp "list")) > > in the Emacs repo. The 3 recent commits have reduced that time from 8s to 6.5s > on my machine (under best conditions: warm disk cache and fresh Emacs > session). The machine is pretty fast, so I figure we can multiply that timing by > 2x, to imagine the average user experience. > > Having exhausted the obvious steps, I have looked at the difference between > defclass and cl-defstruct in this respect. Earlier quick tests indicated there > would be little to no difference, but now that I've wrote the full patch, it's > significant. > > The attached patch drops the timing of the above benchmark further down to 4.1s > here. > > Both allocation ('make-instance' vs auto-generated 'xref-make-*' struct > constructors) and accessing the fields show increased performance, with the > former showing the most improvement: I guess EIEIO's type checking added some > extra overhead. > > That creates some incompatibility (third-party packages can't inherit from > 'xref-location' anymore, or use 'make-instance', 'oref' or 'with-slots' with our > values), but OTOH a quick survey of existing packages that integrate with Xref > shows they wisely don't do that already. Not the largest, popular ones I have > reviewed, at least. > > The ones that do can be updated to rely on the recommended public interface: the > xref-make-* constructors and the generic functions to access the data. This will > keep the code compatible with both new and previous versions of Xref. > > I'd like to push it soon, so users of Emacs 28 can enjoy the speedup. > > What do people think? Yes please.