🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.git
1 messages
1 total messages Started by Justin Tobler Tue, 13 Oct 2026 20:51
Re: [PATCH 2/5] odb/source-files: fix performance when streaming objects with alternates
#433
Author: Justin Tobler
Date: Tue, 13 Oct 2026 20:51
42 lines
9831 bytes
On 26/10/13 09:36AM, Patrick Steinhardt wrote:
> This patch is essentially the equivalent to the preceding patch, but for
> streaming objects instead of just reading them directly.
> 
> Exercising performance is a bit more complicated here as streaming only
> really kicks in for large objects. Furthermore, I expect that the impact
> is not as big as with the last commit, either, because for large objects
> the time to stat the file will probably be dwarfed by the time it takes
> to read the object itself.
> 
> But even though this is probably not as impactful, it makes sense anyway
> to do this change to align behaviour across both of these functions.

I agree that this change is probably not as impactful, but unifying the
behavior makes sense to me and doesn't really have any draw backs. I
think this is a good change.

> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>  odb/source-files.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/odb/source-files.c b/odb/source-files.c
> index 9268f5aa9a..54235821d5 100644
> --- a/odb/source-files.c
> +++ b/odb/source-files.c
> @@ -462,8 +462,10 @@ static int odb_source_files_read_object_stream(struct odb_stream **out,
>  	struct odb_source_files *files = odb_source_files_downcast(source);
>  
>  	for (struct odb_files_dir *dir = files->dirs; dir; dir = dir->next)
> -		if (!odb_source_read_object_stream(out, &dir->packed->base, oid) ||
> -		    !odb_source_read_object_stream(out, &dir->loose->base, oid))
> +		if (!odb_source_read_object_stream(out, &dir->packed->base, oid))
> +			return 0;
> +	for (struct odb_files_dir *dir = files->dirs; dir; dir = dir->next)
> +		if (!odb_source_read_object_stream(out, &dir->loose->base, oid))

Just like the last patch, each source looks through its packfiles first
before looking at loose objects. Looks good.

-Justin
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads