Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] slicethread: Limit the automatic number of threads to 16
Date: Tue, 6 Sep 2022 23:11:04 +0200
Message-ID: <GV1P250MB0737A31512F10DCD912EAC058F7E9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <trinity-7a28de0c-6ad3-4d0e-9f76-41d8316c10d7-1662493821677@3c-app-gmx-bs29>

Lukas Fellechner:
>> Gesendet: Montag, 05. September 2022 um 21:58 Uhr
>> Von: "Martin Storsjö" <martin@martin.st>
>> An: ffmpeg-devel@ffmpeg.org
>> Betreff: Re: [FFmpeg-devel] [PATCH] slicethread: Limit the automatic number of threads to 16
>> On Mon, 5 Sep 2022, Martin Storsjö wrote:
>>
>>> This matches a similar cap on the number of automatic threads
>>> in libavcodec/pthread_slice.c.
>>>
>>> On systems with lots of cores, this does speed things up in
>>> general (measurable on the level of the runtime of running
>>> "make fate"), and fixes a couple fate failures in 32 bit mode on
>>> such machines (where spawning a huge number of threads runs
>>> out of address space).
>>> ---
>>
>> On second thought - this observation that it speeds up "make -j$(nproc)
>> fate" isn't surprising at all; as long as there are jobs to saturate all
>> cores with the make level parallelism anyway, any threading within each
>> job just adds extra overhead, nothing more.
>>
>> // Martin
> 
> Agreed, this observation of massively parallel test runs does not tell
> much about real world performance.
> There are really two separate issues here:
> 
> 1. Running out of address space in 32-bit processes
> 
> It probably makes sense to limit auto threads to 16, but it should only
> be done in 32-bit processes. A 64-bit process should never run out of
> address space. We should not cripple high end machines running
> 64-bit applications.
> 
> 
> Sidenotes about "it does not make sense to have more than 16 slices":
> 
> On 8K video, when using 32 threads, each thread will process 256 lines
> or about 1MP (> FullHD!). Sure makes sense to me. But even for sw decoding
> 4K video, having more than 16 threads on a powerful machine makes sense.
> 
> Intel's next desktop CPUs will have up to 24 physical cores. The
> proposed change would limit them to use only 16 cores, even on 64-bit.
> 

This part is completely wrong: You can always set the number of threads
manually.
(Btw: 1. 8K is the horizontal resolution; the vertical resolution of it
is 4360 (when using 16:9), so every thread processes 135 lines which
have as many pixels as 540 lines of FullHD. 2. FullHD has about 2MP.)

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2022-09-06 21:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 12:20 Martin Storsjö
2022-09-05 19:58 ` Martin Storsjö
2022-09-06 19:50   ` Lukas Fellechner
2022-09-06 20:53     ` Martin Storsjö
2022-09-11 19:00       ` Lukas Fellechner
2022-09-06 21:11     ` Andreas Rheinhardt [this message]
2022-09-11 18:42       ` Lukas Fellechner

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=GV1P250MB0737A31512F10DCD912EAC058F7E9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.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

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/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 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


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