From nobody Wed Sep 08 10:52:36 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F313017C3757 for ; Wed, 8 Sep 2021 10:52:41 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H4Jr964HDz4YvS; Wed, 8 Sep 2021 10:52:41 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-ed1-x52b.google.com with SMTP id g22so2240032edy.12; Wed, 08 Sep 2021 03:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=o38/Mw8M1npDGO6wr9G5BT/YR+I2XzfRBLaZ+RSGzCE=; b=R3jIDVHc/EiTjo2k87Ltttk5+x+c9fokRCf3xAhy0cv63pEreGYCwGvKyyahm65ek9 47dXQJOr4E9N/bkWDJyiNqUqk8e1iCDOk/1nF4hobK2B5SETGUcoq6o2q6864O3ZASsI vHVAUNmg0abFXHUq0bujVQiO1SigQgLM4mrgwN7X+cY6iA6SrjlYHiLSPuD82oP9C1qS S3/1mmmmm3xZbDDhF0h4Exr0TzyVfuGFgkE+mJzwpyPWQ3hG074MLNggbRJHLolZbHnK 38jwnFaeUafEqEl73RF3vJuUxuL5bUls1egcTsCI9LEKDhor+muSAgECiBXLtmD67oqO 1jrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=o38/Mw8M1npDGO6wr9G5BT/YR+I2XzfRBLaZ+RSGzCE=; b=qdGcvHsw2e2IjbEh4LxoZRZcuUBEuM/7Fr2tgxEY04VIb0aUvaJYUTBIcPdcn+4bR6 88Ljc/8KUfCZ1BNbvNJfYiTZSICpMHKVjX9IqjxCQkLascsEEhudxRKAp8ae06c99tlb 0i+tkZV8W7AQB1ahj3Cxtl95bLIjuG46KxZqIH+rX/bk9bBHVnV79OMXHLXuoAsrVSss WnS7AXWYAFJcVgEuJFKcq/aATJYoxAGD84HgolN1WFI1TOH5kdrzJSa7iii5j1Ym7xMY 7e3MNgH6nBMAaOCQ3aU6Ee+cbaOc8wfFHbMW/jSzpJ/xu+LlNc2evsYjeyX0j75ClUYC iyMQ== X-Gm-Message-State: AOAM533CJtaalCkPRSmM/PRIqLy02hlnPdxWRWTzaITob136NkydyHBn oYLLg113SeEqZox1RB8dVMh/EZfHI9s= X-Google-Smtp-Source: ABdhPJyV/EyAkS42tWQt7/KoIfg2xkvd+9vG+tNJpQnyQ6iDIQDJQmEpWLnYRI6wAJRsxCBlv2/weA== X-Received: by 2002:aa7:c14b:: with SMTP id r11mr3214007edp.108.1631098360690; Wed, 08 Sep 2021 03:52:40 -0700 (PDT) Received: from ernst.home (p5b023517.dip0.t-ipconnect.de. [91.2.53.23]) by smtp.gmail.com with ESMTPSA id c2sm579957edk.50.2021.09.08.03.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 03:52:40 -0700 (PDT) Date: Wed, 8 Sep 2021 12:52:36 +0200 From: Gary Jennejohn To: David Chisnall Cc: Stefan Esser , freebsd-current@freebsd.org Subject: Re: -CURRENT compilation time Message-ID: <20210908105236.1abb8f9a@ernst.home> In-Reply-To: <2cfb912a-618b-9f06-9cef-d2fe1d78fe97@FreeBSD.org> References: <2cfb912a-618b-9f06-9cef-d2fe1d78fe97@FreeBSD.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4H4Jr964HDz4YvS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, 8 Sep 2021 09:57:50 +0100 David Chisnall wrote: > On 07/09/2021 18:02, Stefan Esser wrote: > > Wouldn't this break META_MODE? > > I have never managed to get META_MODE to work but my understanding > is that META_MODE is addressing a problem that doesn't really exist > in any other build system that I've used: that dependencies are not > properly tracked. > META_MODE requires filemon(4) to be in the kernel or loaded as a module. make(1) will use if it's available with .MAKE.MODE=meta. > When I do a build of LLVM with the upstream build system with no > changes, it takes Ninja approximately a tenth of a second to stat > all of the relevant files and tell me that I have no work to do. > META_MODE apparently lets the FreeBSD build system extract these > dependencies and do something similar, but it's not enabled by > default and it's difficult to make work. > > > I'd rather be able to continue building the world within a few > > minutes (generally much less than 10 minutes, as long as there is > > no major LLVM upgrade) than have a faster LLVM build and then a > > slower build of the world ... > > The rest of this thread has determined that building LLVM accounts > for half of the build time in a clean FreeBSD build. LLVM's CMake > is not a great example: it has been incrementally improved since > CMake 2.8 and doesn't yet use any of the modern CMake features that > allow encapsulating targets and providing import / export > configurations. > > In spite of that, it generates a ninja file that compiles > *significantly* faster than the bmake-based system in FreeBSD. In > other projects that I've worked on with a similar-sized codebase to > FreeBSD that use CMake + Ninja, I've never had the same problems > with build speed that I have with FreeBSD. > > Working on LLVM, I generally spend well under 10% of my time either > waiting for builds or fighting the build system. Working on > FreeBSD, I generally spend over 90% of my time waiting for builds or > fighting the build system. This means that my productivity > contributing to FreeBSD is almost zero. > > For reference, changes to LLVM typically build for me in under 30 > seconds with Ninja, unless I've changed a header that everything > > In particular, building FreeBSD on a 10-24 core machine has very > long periods where a number of the cores are completely idle. > > Ninja also has a few other nice features that improve performance > relative to bmake: > > - It lets you put jobs in different pools. In LLVM this is used to > put link and compile jobs in different pools because linking with > LLD uses multiple threads and a lot more memory than compilation, so > a 10-core machine may want to do 12 compile jobs in parallel but > only 2 link jobs. This makes it much easier to completely saturate > the machine. > - Ninja provides each parallel build task with a separate pipe for > stdout and stderr, and does not print their output unless a build > step fails (or unless you build with -v). With bmake, if a parallel > build fails I have to rerun the build without -j, because the output > is interleaved with succeeding jobs and it's difficult to see what > actually failed. With ninja, the output is from each failed job, > with no interleaving. > ninja sounds really neat and it's available as /usr/ports/devel/ninja. Seems to me that there was an earlier mail about getting CMAKE to work with FreeBSD builds. Could be worthwhile to look into getting ninja to work also. But I could understand that there might be push-back, since the project prefers to use utilities from the source tree. -- Gary Jennejohn