From: Christian Couder Date: Mon, 19 Feb 2024 21:32:07 GMT Subject: Re: [PATCH v5 9/9] format_trailers_from_commit(): indirectly call trailer_info_get() Message-ID: In-Reply-To: <7c656b3f77546ae917ff192031c62d4521d9df8c.1708124951.git.gitgitgadget@gmail.com> On Sat, Feb 17, 2024 at 12:09 AM Linus Arver via GitGitGadget wrote: > > From: Linus Arver > > This is another preparatory refactor to unify the trailer formatters. > > Instead of calling trailer_info_get() directly, call parse_trailers() > which already calls trailer_info_get(). This change is a NOP because > format_trailer_info() only looks at the "trailers" string array, not the > trailer_item objects which parse_trailers() populates. Is the extra processing done by parse_trailers() compared to trailer_info_get() impacting performance? Also when looking only at the patch, it's a bit difficult to understand that the "trailers" string array is the `char **trailers` field in `struct trailer_info` and that the trailer_item objects are the elements of the `struct list_head *head` linked list. It could also be confusing because the patch is adding a new 'trailers' variable with `LIST_HEAD(trailers);`. So a few more details could help understand what's going on. > In a future patch, we'll change format_trailer_info() to use the parsed > trailer_item objects instead of the string array. Ok, so I guess the possible performance issue would disappear then, as populating the trailer_item objects will be useful.