From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66]) by sourceware.org (Postfix) with ESMTPS id 8A93B3858D28 for ; Mon, 17 Jul 2023 18:58:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A93B3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 977E23C011BD4; Mon, 17 Jul 2023 11:58:32 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 62817mEHa6dt; Mon, 17 Jul 2023 11:58:32 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 148F33C011BD5; Mon, 17 Jul 2023 11:58:32 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 148F33C011BD5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1689620312; bh=yiyDmoAcdSftH8LVwqIHJtMhkHMSJSVJ9+C08kBkvGk=; h=Message-ID:Date:MIME-Version:To:From; b=lJuPA35uxubWcWpgZa+CqhXJjOk4mLz1t7Vmgm/o80o2ybr/SPMfdPRHZfI4/mA5Z i04gsAA7+9Le/xI1Y/tMzBj8swYhqIBaVNObEwHHCvIvoqmdknn5K+FrqaKBXPHHpt hQBpBThBHQcgIxN6Ambv9BRaOa2pUDTR7KgBCuFq/RfkYAx8cILw8pYAObPqj2mmkI 8bZaAKccD4Z6cQmIPC2wJfTXTz4bYulrtODIUp7wpmW2veCejyRdhlKRHLm9xiY/xQ xViQpAyE1C6CcKIbfaKGbeHYLWbbyT1Ikab3/17IShiUlklx8Cqpf3/XeuP2I2ePyt kTYC9BDLD5jgw== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id W54G9zt3NWDF; Mon, 17 Jul 2023 11:58:32 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id E17D03C011BD4; Mon, 17 Jul 2023 11:58:31 -0700 (PDT) Message-ID: Date: Mon, 17 Jul 2023 11:58:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v5 1/6] stdlib: Optimization qsort{_r} swap implementation Content-Language: en-US To: Adhemerval Zanella Netto , Alexander Monakov Cc: libc-alpha@sourceware.org References: <20230713132540.2854320-1-adhemerval.zanella@linaro.org> <20230713132540.2854320-2-adhemerval.zanella@linaro.org> <49920fe1-b5a1-939c-9d34-bd553cd4352e@ispras.ru> <38f59f55-13a4-1a5a-9ba1-34c6ed70d964@cs.ucla.edu> From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-07-17 11:07, Adhemerval Zanella Netto wrote: > I am not sure in fact, my take was the code as simple enough to have this > concern. The usual rule of thumb is that ten lines are trivial, and that more than that might be a concern. When it's a concern, you can't simply read the original code and rewrite it in a different way; you need to actually rewrite it from scratch, preferably without looking at the original code. It's a pain, admittedly.