All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 04/16 v2] package/infras: do not conditionally set empty variables
Date: Thu, 30 Dec 2021 21:43:19 +0100	[thread overview]
Message-ID: <20211230214319.2c2fe3ec@windsurf> (raw)
In-Reply-To: <659c748d4a2913f6bc9ea8cb5e2693fac0bf0542.1636810092.git.yann.morin.1998@free.fr>

On Sat, 13 Nov 2021 14:28:15 +0100
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Setting an unset variable to an empty value is useless in make; an unset
> variable just expands to an empty string anyway. So what we do currently
> has no side effect:
> 
>     variable set and not empty   -> variable not modified
>     variable set and empty       -> variable not modified
>     variable unset               -> set to an empty string
> 
> However, additional variables do have an impact on the parsing time of
> the Makefiles, and the more variables, the more collisions in the hash
> table used internally by make, which slows down the parsing.
> 
> By dropping those conditionally-set-empty variables, we gain about 3%:
> 
>     Run     Before  After
>     1       5.572   5.325
>     2       5.434   5.354
>     3       5.490   5.320
>     4       5.525   5.330
>     5       5.476   5.330
>     6       5.511   5.434
>     7       5.498   5.388
>     8       5.524   5.371
>     9       5.479   5.346
>     10      5.637   5.324
>     Mean:   5.515   5.352
> 
> Yeah, 0.163s does not look like much, and this does not make
> autocompletion any more usable. Still, that 3% gain is not to be
> ashamed of either.
> 
> Note that there are 3 others case where we do set empty variables, but
> those are unconditional and serve other purposes:
> 
>   - pkg-virtual: this is done on purpose to avoid a bug when the
>     environment may have TOOLCHAIN_VERSION or _SOURCE set, and we really
>     want those to be empty, so the assignment is not conditional;
> 
>   - pkg-python: the reason for setting those to empty is dubious at
>     best; it's been there since the inception of the python infra, back
>     in 2013; still, the case is different than this patch addresses;
> 
>   - pkg-toolchain-external: this is the case for a toolchain already
>     installed, so indeed we want to set _SOURCE and _VERSION to empty.
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  package/pkg-autotools.mk |  4 ----
>  package/pkg-cmake.mk     |  4 ----
>  package/pkg-generic.mk   | 27 ---------------------------
>  package/pkg-kconfig.mk   |  3 ---
>  package/pkg-meson.mk     |  4 ----
>  package/pkg-python.mk    |  4 ----
>  package/pkg-qmake.mk     |  4 ----
>  package/pkg-waf.mk       |  5 -----
>  8 files changed, 55 deletions(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2021-12-30 20:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13 13:28 [Buildroot] [PATCH 00/16 v2] core: add show-vars, a json-formatted equivalent to printvars (branch yem/show-vars) Yann E. MORIN
2021-11-13 13:28 ` [Buildroot] [PATCH 01/16 v2] core/show-info: report build_dir relative to CONFIG_DIR Yann E. MORIN
2021-11-13 13:28 ` [Buildroot] [PATCH 02/16 v2] package/kodi-*: run pkg-config at build time, not at parse time Yann E. MORIN
2021-11-13 13:28 ` [Buildroot] [PATCH 03/16 v2] support/dependencies: avoid spurious warning on print-vars Yann E. MORIN
2021-11-13 13:28 ` [Buildroot] [PATCH 04/16 v2] package/infras: do not conditionally set empty variables Yann E. MORIN
2021-12-30 20:43   ` Thomas Petazzoni [this message]
2021-11-13 13:28 ` [Buildroot] [PATCH 05/16 v2] package/pkg-python: do not " Yann E. MORIN
2021-12-30 20:43   ` Thomas Petazzoni
2021-11-13 13:28 ` [Buildroot] [PATCH 06/16 v2] core/pkg-generic: also list files installed in images/ Yann E. MORIN
2021-11-13 13:28 ` [Buildroot] [PATCH 07/16 v2] Makefile: really comment syntax colouring Yann E. MORIN
2021-11-13 13:28 ` [Buildroot] [PATCH 08/16 v2] core/show-info: 'name' only applies to packages Yann E. MORIN
2021-12-12 22:18   ` Peter Korsgaard
2021-11-13 13:28 ` [Buildroot] [PATCH 09/16 v2] support/utils: make-comma-list does just that, not quoting Yann E. MORIN
2021-12-30 20:43   ` Thomas Petazzoni
2021-11-13 13:28 ` [Buildroot] [PATCH 10/16 v2] support/misc/utils: introduce $(tab)=\t and $(escape)=\x1b Yann E. MORIN
2021-12-30 20:43   ` Thomas Petazzoni
2021-11-13 13:28 ` [Buildroot] [PATCH 11/16 v2] package/pkg-utils: introduce helper to properly json-escape a string Yann E. MORIN
2021-12-30 20:43   ` Thomas Petazzoni
2021-11-13 13:28 ` [Buildroot] [PATCH 12/16 v2] package/pkg-utils: generate proper JSON strings where they are emitted Yann E. MORIN
2021-12-30 20:43   ` Thomas Petazzoni
2021-11-13 13:28 ` [Buildroot] [PATCH 13/16 v2] core/show-info: report whether a package is overriden Yann E. MORIN
2021-12-30 20:45   ` Thomas Petazzoni
2021-12-31 17:28     ` Yann E. MORIN
2021-11-13 13:28 ` [Buildroot] [PATCH 14/16 v2] core/show-info: also export source and stamp directories in show-info Yann E. MORIN
2021-12-30 20:45   ` Thomas Petazzoni
2021-11-13 13:28 ` [Buildroot] [PATCH 15/16 v2] core/show-info: report package build steps and stamp files Yann E. MORIN
2021-12-30 20:46   ` Thomas Petazzoni
2021-12-31 18:03     ` Yann E. MORIN
2021-11-13 13:28 ` [Buildroot] [PATCH 16/16 v2] Makefile: introduce show-vars, a json-formatted equivalent to printvars Yann E. MORIN
2021-12-30 20:47   ` Thomas Petazzoni
2021-12-04 19:12 ` [Buildroot] [PATCH 00/16 v2] core: add show-vars, a json-formatted equivalent to printvars (branch yem/show-vars) Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211230214319.2c2fe3ec@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@buildroot.org \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.