From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id BBDBA1F597 for ; Mon, 30 Jul 2018 18:39:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731637AbeG3UQL (ORCPT ); Mon, 30 Jul 2018 16:16:11 -0400 Received: from mail-qk0-f174.google.com ([209.85.220.174]:45390 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729198AbeG3UQK (ORCPT ); Mon, 30 Jul 2018 16:16:10 -0400 Received: by mail-qk0-f174.google.com with SMTP id c192-v6so8513977qkg.12 for ; Mon, 30 Jul 2018 11:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=F5q0fyTONVDnNzYUjLvJYfOFfb0xQt5inXAjF0OQ5jQ=; b=UkkBc8JQygJ/8jI8RSoXZwLCjX9my6rZD1W4fCIU4Fv8No7tLiHGqgNn1v282oxS9R qw73P/R6Qy7yjJ0ArW/DfXCJOd6NTj1M32V/Xr13mYjKXP+64dWUCMffjouOQ5y6sczm VsTtvanDTgGZgg7U/lOl0EYS+ow1LvDEwOwO+0Mwg6lLiu9yc6z17O3v1yoKH9gwzLHw NsvDIPA2Pm1ieU/k2O0t9d5BSGNzngA69/cBFgj8ZUKeVwoSNfWTIVJHsD37criTiM6C s18CwAx9msZTSc07mNLZX2Ln9hRMwlxe5j7jaWDemIKciDlVUlM6M0lhTFvVYlYQci1e GDCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=F5q0fyTONVDnNzYUjLvJYfOFfb0xQt5inXAjF0OQ5jQ=; b=cxzKKCXqJubdWXtejaMiYV4QPngSwOuVFSRE99UbhI+/y78IBwfgmjWCHDp8IPIPBd 7V4WKK072/SLZ6YCsn3fRnBt6EtcKpaJMybLaW8vQdvkblAGmt5kzMDcht2f8prHpktN GhBpjeB/TCUWpRZphPhRRq3CLluCGvi/G3MyOTHlxQrfM2KpAqi9cwXg1MopvFOdTzMr TPWnVYv6XBcXwYMsikWVG86NatCGTKzQ5ebTo1jBLfUxpFrnHJ2fnsNlYwxFV4bBYTec rTxhwZ41bh2uYWMd+AGqxNP+Dp1/g0AsHlMiH/TU+D4YeReg52YiFsAmcBxzK3lkovGF YtNQ== X-Gm-Message-State: AOUpUlER0CoiiW5Vmm2BsbC0FqsoTuGQPPRuXnxFpA6zZHOIImumAVM0 0K0LbN5Q0gmmNJzTr9w/a5ReViMGmf9Aui6ncSA= X-Google-Smtp-Source: AAOMgpczWPFWHGKuSks7GeeluVj3g7cUxEMPkSomtYD5t5+WW+4ZPsKpgerdJvRQYvYBW/Ajx6GH5CxiRmK4MKJukBw= X-Received: by 2002:a37:4ed8:: with SMTP id c207-v6mr17472682qkb.164.1532975992759; Mon, 30 Jul 2018 11:39:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:25aa:0:0:0:0:0 with HTTP; Mon, 30 Jul 2018 11:39:52 -0700 (PDT) In-Reply-To: References: <20180729181006.GC945730@genre.crustytoothpaste.net> <2309fa7f-c2d8-ee57-aff5-b9e32d2da609@felt.demon.nl> <20180729192753.GD945730@genre.crustytoothpaste.net> <20180729200623.GF945730@genre.crustytoothpaste.net> <701d9f4b-efbd-c584-4bec-bddb51b11d96@felt.demon.nl> <87wotdt649.fsf@evledraar.gmail.com> From: Daniel Shumow Date: Mon, 30 Jul 2018 11:39:52 -0700 Message-ID: Subject: Re: Is detecting endianness at compile-time unworkable? To: Junio C Hamano Cc: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Michael , "brian m. carlson" , git@vger.kernel.org, Jeff King Content-Type: multipart/alternative; boundary="0000000000007f6c0605723bc99a" Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org --0000000000007f6c0605723bc99a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The change was definitely made for performance. Removing the if statements, conditioned upon endianess was an approx 10% improvement, which was very important to getting this library accepted into git. Thanks, Dan On Mon, Jul 30, 2018 at 11:32 AM, Junio C Hamano wrote: > Junio C Hamano writes: > > > =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason writes: > > > >> And, as an aside, the reason we can't easily make it better ourselves = is > >> because the build process for git.git doesn't have a facility to run > >> code to detect this type of stuff (the configure script is always > >> optional). So we can't just run this test ourselves. > > > > It won't help those who cross-compile anyway. I thought we declared > > "we make a reasonable effort to guess the target endianness from the > > system header by inspecting usual macros, but will not aim to cover > > every system on the planet---instead there is a knob to tweak it for > > those on exotic platforms" last time we discussed this? > > Well, having said all that, I do not think I personally mind if > ./configure learned to include a "compile small program and run it > to determine byte order on the build machine" as part of "we make a > reasonable effort" as long as it cleanly excludes cross building > case (and the result is made overridable just in case we misdetect > the "cross-ness" of the build). > > --0000000000007f6c0605723bc99a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The change was definitely made for performance.=C2=A0 Remo= ving the if statements, conditioned upon endianess was an approx 10% improv= ement, which was very important to getting this library accepted into git.<= div>
Thanks,
Dan


On Mon, Jul 30, 2018 at 11:32 AM= , Junio C Hamano <gitster@pobox.com> wrote:
Junio C Hamano &l= t;gitster@pobox.com> writes:
> =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason <avarab@gmail.com> writes:
>
>> And, as an aside, the reason we can't easily make it better ou= rselves is
>> because the build process for git.git doesn't have a facility = to run
>> code to detect this type of stuff (the configure script is always<= br> >> optional). So we can't just run this test ourselves.
>
> It won't help those who cross-compile anyway.=C2=A0 I thought we d= eclared
> "we make a reasonable effort to guess the target endianness from = the
> system header by inspecting usual macros, but will not aim to cover > every system on the planet---instead there is a knob to tweak it for > those on exotic platforms" last time we discussed this?

Well, having said all that, I do not think I personally mind if=
./configure learned to include a "compile small program and run it
to determine byte order on the build machine" as part of "we make= a
reasonable effort" as long as it cleanly excludes cross building
case (and the result is made overridable just in case we misdetect
the "cross-ness" of the build).


--0000000000007f6c0605723bc99a--