From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: master 4b79c80c999 1/2: New function 'sort-on' Date: Mon, 5 Feb 2024 16:47:39 +0200 Message-ID: <005a364e-5058-42ae-b679-96dc046dccea@gutov.dev> References: <170688047526.14693.2994051491358257471@vcs2.savannah.gnu.org> <20240202132756.4272CC0EFE7@vcs2.savannah.gnu.org> <87cytej4hy.fsf@daniel-mendler.de> <86zfwi52m1.fsf@gnu.org> <87plxe28as.fsf@web.de> <86wmrm50i5.fsf@gnu.org> <3ff9d4cf-7b4f-4924-8663-3f43625760bf@gutov.dev> <86le7z0yqh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11127"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: yuri.v.khan@gmail.com, michael_heerdegen@web.de, jwiegley@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 05 15:48:39 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 1rX0H0-0002fn-6A for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Feb 2024 15:48:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX0GH-0001J8-Ce; Mon, 05 Feb 2024 09:47:53 -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 1rX0GE-0001Ip-Hx for emacs-devel@gnu.org; Mon, 05 Feb 2024 09:47:51 -0500 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rX0GA-0007qD-Vm; Mon, 05 Feb 2024 09:47:49 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 3B6C43200A68; Mon, 5 Feb 2024 09:47:43 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 05 Feb 2024 09:47:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1707144462; x=1707230862; bh=ixRQUtoc0KtpPb4a2GOyQhg1XS7UhZbYCFeHtct3moY=; b= HEgL0uPtcQH/ShpUsfBzfzgAr5linKzwY/PLtPAJLisjlJHBHRAGUwWS6fXOWOFJ GBjaPk+xzGT4sFKbZ3RWNJtCalc7tp7H3bYfr8BcISnlahbFWrR+oM3pn0seA8r8 KjSKHWL/4EIWo+Z8eM4kUhQKT3ZaumWtQIwhbDHN9UFt+Guae2aTgNvSD9AM37Cg v70uRaYLytkiPZu9ZyXQ1ejlVBtlfT9ykSQqQGUrbzpR4IUiPaGcLGWnKZq2QzC/ ryHCmxlOP0BQ31SWeZab2S7XqfyX8/+SZA1zBsWbdVx6FufLuGZZmdzqGn3XwWSA IHkZ7u13nHcIoSUrKWTXVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1707144462; x= 1707230862; bh=ixRQUtoc0KtpPb4a2GOyQhg1XS7UhZbYCFeHtct3moY=; b=N G9yC1vxfcZEOcuqBAtXkkY7hMfNCnTq7LM7L5m+S9mva5tBP6KkrSV3rbpBfufRg 1+nLYjRzUhW53x9eOdmy6qwi0sUzQnvZj0WfJhNxkAz1CsLzph1lpunAh3ppwlK4 RBbhHW8lC/OCmNZ9KUwXxLmh2GzM9hLktSRqXAzhUzO0aBCp0QvP7kGc7X2t9f8R P4p9L0DrqQmtVkqEoiQM/dPpCs1lzSTWgZ52zF9uOAKP4vlHLm4+43OwHWml1F9C ZlP0xhG7J5xfQgGQZJCyQO01AjxllAmGB2B6olYUiqzm6QwB4xQ6fyaIfPlOZT5J 82lOJlgZWc2DTS0bYc7Dw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedvtddgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Feb 2024 09:47:41 -0500 (EST) Content-Language: en-US In-Reply-To: <86le7z0yqh.fsf@gnu.org> Received-SPF: pass client-ip=64.147.123.20; envelope-from=dmitry@gutov.dev; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action 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:315892 Archived-At: On 05/02/2024 16:31, Eli Zaretskii wrote: >> Date: Mon, 5 Feb 2024 15:25:59 +0200 >> Cc: Eli Zaretskii, Michael Heerdegen >> , John Wiegley, >> emacs-devel@gnu.org >> From: Dmitry Gutov >> >> On 05/02/2024 07:30, Yuri Khan wrote: >>> On Mon, 5 Feb 2024 at 07:49, Dmitry Gutov wrote: >>> >>>> The result would make it destructive and consequently faster (not >>>> entirely non-consing, but close to it--while the current sort-on creates >>>> two extra lists of length N), which should fit the original goal: a >>>> faster sorting routine then uses ACCESSOR. >>> Schwartzian transform transforms a sort algorithm that is O(n log n) >>> accessor calls + O(n log n) comparison calls into one that is O(n) >>> accessor calls + O(n log n) comparison calls. Depending on the >>> accessor expensiveness, that may or may not balance out the consing >>> and eventual GC. >> Users who don't want to use the transform could inline the accessor >> calls into the comparison function instead (as many have done in the >> past). So if we document this properly, it should be fine. > It's already documented (in the ELisp manual). You can't document something that's not in the tree.