ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Ivan A. Melnikov" <iv@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: [devel] make ninja-build fast again
Date: Wed, 14 May 2025 21:54:08 +0400
Message-ID: <wr2srmxfrmzlgguh625xn6h4xjcyujdm6ftkp4txnrmvxr7sgc@lhb6hdawxc6c> (raw)

Приветствую.

Я тут обнаружил, что ninja-build в Сизифе стал как-то хтонически
небыстр. Чтобы оценить масштаб трагедии, я собрал из подручных
материалов небольшой бенчмарк[1], запустив который на tmpfs
получил потрясающие результаты:

make  -- 0:01.00elapsed 
samu  -- 0:00.90elapsed
ninja -- 0:45.00elapsed

Реально, в 45 раз мелненнее make и в 50 раз медленнее samurai?
Её нужно спасать!

В логах обнаружилось, что при сборке ninja потерялся %optflags,
и она собиралась вообще без оптимизаций. Вернув %optflags,
я добился ускорения чуть больше чем в 2 раза, до ~19 секунд.

Однако возвращение %optflags позволило убрать параметр `--debug`,
всё равно получая работоспособный debuginfo (да, я проверял)
у сборочного скрипта, что, благодаря -DNDEBUG, вернуло
производительность ninja в норму.

В таком виде пакет ушёл в Сизиф (задача 384155 DONE,
надеюсь никому ничего не сломал).

Предлагаю мейнтейнеру как-то проверять производительность
при последующих обновлениях. Также можно перейти на сборку
cmake'ом, как это сделали, например, в debian, чтобы всяческие
best practices следовали за собой сами.

[1] https://git.altlinux.org/people/iv/public/?p=build-tool-benchmarks.git

-- 
  wbr,
    iv m.


                 reply	other threads:[~2025-05-14 17:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=wr2srmxfrmzlgguh625xn6h4xjcyujdm6ftkp4txnrmvxr7sgc@lhb6hdawxc6c \
    --to=iv@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /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

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git