From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6CB5C4BEBE for ; Thu, 18 Jul 2024 09:09:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0CF7168D9C1; Thu, 18 Jul 2024 12:09:07 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3AD2868D683 for ; Thu, 18 Jul 2024 12:09:00 +0300 (EEST) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=cxKSDTF6; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id DDE10240DB8 for ; Thu, 18 Jul 2024 11:08:59 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Rce0BhVO8lkW for ; Thu, 18 Jul 2024 11:08:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1721293739; bh=1Nby/noFrRnUuTc5lH2pV95IrE4yB5v+ApCp4t6/6bw=; h=Subject:From:To:In-Reply-To:References:Date:From; b=cxKSDTF6TZZA0MUGfmXf5bhv+y+eoI2zoj6+jzBbNfc6G/enjDV2Iw+F+e0GvFC1t KIHKabbwdobYUbI8h9uTrbAZpJO35RV77/SA6Z7yX0g3le4sMI3j5G/vUfRFnhMb7F FAUDXlbRQ0p4c4MNLabFwWfLJkH+hVZbL4tmGGPNWGN+ggZ8vocUHPB853dDS4dAdr c0DTT9m2g425eBQBaBo3d9mFP3y3ZyOsY4C3EZavl9eGZUtEvfluFKOAloYDGGz2k3 SFnjJFgDget/2UHZo7GHy4f6BYUrXE5r+aX/mLj1nrGcE+qtcbvlaZqkDs4QQ0sDVY eIWbUxOUHt+Rg== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 2E822240DB7 for ; Thu, 18 Jul 2024 11:08:59 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 0B32C1601B9; Thu, 18 Jul 2024 11:08:59 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20240717224205.GY4991@pb2> References: <20240716171155.31838-1-anton@khirnov.net> <20240716171155.31838-10-anton@khirnov.net> <20240717224205.GY4991@pb2> Mail-Followup-To: FFmpeg development discussions and patches Date: Thu, 18 Jul 2024 11:08:59 +0200 Message-ID: <172129373901.21847.12392144255635795802@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 10/39] lavc/ffv1dec: move the bitreader to stack X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Michael Niedermayer (2024-07-18 00:42:05) > all the stuff should be put together close so its efficiently > using CPU caches Which is why it shares its cacheline with PutBitContext, because the code benefits from having the both in the cache, right? And the 4-byte hole in PutBitContext is there presumably to aerate the cache for smoother data streaming. More seriously, this is not how caches work. Being close together matters mainly so long as your data fits in a cacheline, beyond that physical proximity matters little. On stack, the bitreader is likely to share the cacheline with other data that is currently needed, thus improving cache utilization. Another factor that matters in efficient cache use is e.g. not having multiple copies of the same constant data scattered around, which you're objecting to in my other patches. -- Anton Khirnov _______________________________________________ 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".