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.devel Subject: Re: Some thoughts about Emacs performance Date: Fri, 09 Feb 2024 00:53:02 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25976"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: robertstephenboyer@gmail.com, emacs-devel@gnu.org To: yantar92@posteo.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 09 05:21:04 2024 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 1rYINp-0006WB-Ue for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Feb 2024 05:21:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYIN1-0007as-LG; Thu, 08 Feb 2024 23:20:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYECh-0008AN-Rr for emacs-devel@gnu.org; Thu, 08 Feb 2024 18:53:16 -0500 Original-Received: from mail-he1eur04olkn2106.outbound.protection.outlook.com ([40.92.73.106] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYECc-0000rm-FA for emacs-devel@gnu.org; Thu, 08 Feb 2024 18:53:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TwYulr29+jf093MNxpPwVpX34GsSGS3hNBJYX+tmSbBugo7q68b5OEYMzfKyDKqwVoUw00Zpa7GqqohU8bvFUsoUDo4dJL1ulZnoqipWd4JuydZAoPKkk7w3ztflDDDIivZ6Zr02ECgUDGIcIGctqhSlFjfGpvfL+ASI5rHcg0N1ch1IbARnSltLqr8GAWn4R8Lfwes4w6SVrrdZz1C7odeBYKRfyrZPf0+RsgWyOLrbA0WScaDUzhry21IuNEuakys/zv3FeiGBlyPvsaCnfqn2kgS565moBF30soA7/QA/QgolukV8gAMTRJj9cW3Anc5F2J3oNnx3bK2VYOIz6A== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=prgmuc3MUQZ4sIghJQx564bSy08MBDf40/vhaQ7FH8c=; b=CDVK/tbK3SHtntK9J3poTE1OZvCa5iN5bZVFSSv3EL5XeJcpaECAb6wMr5gzYXwz9kG2UDxQEC0Xc6wnvsG/y1WrEJWR1u87O9Dl0HM5RrdoAOpyLsf++Gop4wn8/OJP7XPbEbOV7p2PxbET0QIG7BnwmQ3e/P7iQwFDkF1Fo6dL280l02g2+g828jV2MNVZTNs/vBH5cMcWktLtNuO3HWnBZNvl4P8OXsu2qpm+u+AxFWYqikn5jLAVqtB/nTcl6rusyatbQeAMXLxVeGgDvfDmuulyBXtxAUpTV+Rz2VkOvT+3tTIT1ZxKkjyG5YCwvn6RylP5tS6VAHh/QUPXmA== 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=prgmuc3MUQZ4sIghJQx564bSy08MBDf40/vhaQ7FH8c=; b=Sp6VKfqIxRGRqjp6K0UFkQCV2fENkb9ZfnSYX8Asd9JsV2Wwvu86q4iJOz5v4x+EtJUxSj8q8fXlwsGk5isGKrytcygm/YLI1MujSeKsa4QFxvt12IjMtL+mjSRdHE26eZsKVpZg4Wxs4tW0YtajBPXpKjDql/nMXviN0yRqmS/H+sMCikCYh2uAqbwwNXgmltw38aOHtgxKiyyFRAHmTMt4crsyU1S2/lNOVqh3FgmY5QmA8aML1ni9gg4+vLl1Y0yIhxKw9zrQ73wCtMDgGYREopjIUs1J9wHpS5f2CDXtg2N80drhhi1RLZZz7dE9XULF6Zg+/+PLDcO8mOR7Ig== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by AS2PR02MB9213.eurprd02.prod.outlook.com (2603:10a6:20b:5fa::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.37; Thu, 8 Feb 2024 23:53:06 +0000 Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::b91:5e3:fb4a:3b2c]) by DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::b91:5e3:fb4a:3b2c%3]) with mapi id 15.20.7249.039; Thu, 8 Feb 2024 23:53:06 +0000 X-TMN: [6yZnNHo08prz+8g56KM6cgyO76kcKOyL] X-ClientProxiedBy: OS6P279CA0020.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:33::14) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <86le7upl7l.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|AS2PR02MB9213:EE_ X-MS-Office365-Filtering-Correlation-Id: f46accdf-7171-4948-b007-08dc2901183e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ynsk7eDs2YSonzlXZolO0N0OUub/fnOaaJFe5YuCqrzpWO7dqsz+Fn5Rlg1nJtDHI5HQIcZQYncz7eYakvL/lXeV1/HH8jGt68XYwnVZ02AaJxwyF8PD5/nljAH3MoDVafNKg5lyQ4tGJgajUzZ9gDpyH7/dl5hFNTklCk88lDjvT72QOCEPvCMs/bLXL6lxrphJl0U6A2H+4pxxHR1fcJO4iNl+lGhd+he4SQGWPLBuJ6S9MNQOSkkcH+W6kG+gcKAihkK94jjU2wTtQlSdaF3R93qY29MfajaOezlYSndtX66BknIh9imz9wpHTjINlNsA7isLE8lJ4BIJc5nKmLAusV79q3SHybBbajCwoaLYSIzX/hMnVMSTixHcBLyznV9aG23VhVATDxKx6QbR6+h5r2Btcp9HxCST8trFwGmcWI7oivibZA47QXOh7e1app08GGcK7qnfVnmn/AM3vKJql2XgNhKqqfHJz0JAL0Xnb95c5z8PwZTgaYCnfyJ5eWcQvR846ftD61EF4KlB+ZMAm3TMb3rAJHmWNEuHvF1sEleH0OuKauO7qObBNkCC X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?JPoIuDlq1iusqQa0JJ9KCKs9Qks++JtltcslKdksbwnvrlnQWH5lzMuiIUVy?= =?us-ascii?Q?yW1f+EOoN7NkabS5W3O2hKQlwkNBIGPpplmopBNkfIYBVKiGtroOAL95dkt/?= =?us-ascii?Q?YYPDIZx/6j2yG3cH1dUBuzsA859LB2DODOuw1vhWCFivqpgm5mxNoPb9t3yh?= =?us-ascii?Q?IpIOYKMNLpPDylvNa4pkr28Qv7zvSCWLVnDnKmmZmQRogCcUA5GvQ2x5IaO7?= =?us-ascii?Q?SjKjnDguzWDXcpNZbj9MnX2FIcxYFLQ+RI3GHnQK2yvsF69J4LBAO/5pTsQX?= =?us-ascii?Q?P02cVDo/JQkVVIy4lTT1evDb0t1FkNyC/9MCdvW5p4xUvwGowZG+fsTUwYGb?= =?us-ascii?Q?IewQyWuCCPOse241tFwu2E6X1p9aSR2Bf1Q9AQxHOHyvcRXmXkhZ89Z3KWhr?= =?us-ascii?Q?xHuexu3jh90ZyAcbgFJDiumMbsq0mQ/i2oGYn0ncXiG1WPGRbvFJc3DFxCm5?= =?us-ascii?Q?asjBZduG1Y5XcAs9giRZqSyOG7m5Ui1zjdQRHOMZAXfOlzSWgqWkki+zWjsK?= =?us-ascii?Q?49FVrzF5l8+cqeGzHm+XW91Yu5meOyjpf8Bz/99Q195+MRx93tODMlNIjHIE?= =?us-ascii?Q?PaEJ6GHQpB3jk6mfiLxHVfLBY2asymFVHlo3D6FRrMAspXkyK6jJCc9vVkz+?= =?us-ascii?Q?Ub X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: f46accdf-7171-4948-b007-08dc2901183e X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2024 23:53:06.1161 (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: AS2PR02MB9213 Received-SPF: pass client-ip=40.92.73.106; envelope-from=arthur.miller@live.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FAKE_REPLY_C=1.486, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 08 Feb 2024 23:20:09 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316060 Archived-At: >Robert Boyer writes: > >> Emacs 27.1 has a 'sort' function that takes longer than stable-sort of >> SBCL. Maybe >> by a factor of 2. See also my attached file 'ms.lisp'. >> >> There may be a lot that can be improved in Emacs' >> handling of cl-loop, setf, elt, or cl-random. > >When comparing Elisp and SBCL, it is more fair to compare >native-compiler Elisp rather than byte-compiled. >Then, both codes are compiled to machine code. The sort is implemented in C, so it does not matter so much, but I did compiled to native with comp-speed 3, and I have replaced cl-random (lisp) call with call to random (C). What I have seen was that on first few runs, sbcl was faster. Definitely not as a drammatic difference as in Robert's test, but SBCL was still somewhat faster: Emacs: (benchmark 1 '(setq foo (make-random-array (expt 10 n)))) Elapsed time: 0.097354s (0.053204s in 1 GCs) (benchmark 1 '(sort foo '<)) Elapsed time: 0.271281s SBCL: CL-USER> (time (defparameter foo (make-random-array (expt 10 n)))) Evaluation took: 0.020 seconds of real time 0.015625 seconds of total run time (0.000000 user, 0.015625 system) 80.00% CPU 50,840,363 processor cycles 8,000,016 bytes consed CL-USER> (time (progn (stable-sort foo '<) nil)) Evaluation took: 0.165 seconds of real time 0.125000 seconds of total run time (0.109375 user, 0.015625 system) 75.76% CPU 413,349,272 processor cycles 8,000,016 bytes consed That was consistent for few times. However, after some time, Emacs was beating SBCL in sorting. Emacs for sort was varying 0.015 ~ 0.02; mostly ~0.017. SBCL, was varying 0.065 ~ 0.085, mostly ~0.065. For array creation, SBCL is beating Emacs, every time, by a magnitude. Emacs was around 0.1 ~ 0.12, while SBCL was 0.017 ~ 0.022 Speeds were quite stable for both Emacs and SBCL in later runs. Unfortunately I only have access to older sbcl version on Windows; I have seen from the mailing list that they have been working on the sort implementation so it will be exciting to see what they have come up with. Emacs version: GNU Emacs 29.2 (build 2, x86_64-w64-mingw32) of 2024-02-01 (build from GNU ftp server 29.2_1 for Windows OS - can't build myself configure script fails) CPU: 13th Gen Intel(R) Core(TM) i5-1345U 1.60 GHz RAM: 16 GB OS: Win 11 build 22H2 $ sbcl --version SBCL 2.3.2