git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/1] blame: remove unnecessary use of get_commit_info()

From
Rafael Silva <rafaeloliveira.cs@gmail.com>
Date
Feb 17, 2021, 14:54 UTC
Message-ID
<20210217145443.36764-1-rafaeloliveira.cs@gmail.com>
In-Reply-To
<20210216163151.76307-1-rafaeloliveira.cs@gmail.com>

Thanks Taylor, Derrick and Junio for reviewing v1. I've updated the patch's message to include one of the performance reports that was previously only on the cover-letter as suggested.

Rafael Silva (1):
  blame: remove unnecessary use of get_commit_info()
 builtin/blame.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Range-diff against v1:
1:  e0c698370e ! 1:  4d70ce9545 blame: remove unnecessary use of get_commit_info()
    @@ Commit message
         structure and remove the internal call to get_commit_info() thus
         cleaning up and optimizing the code path.
     
    +    Enabling Git's trace2 API in order to record the execution time for
    +    every call to determine_line_heat() function:
    +
    +       + trace2_region_enter("blame", "determine_line_heat", the_repository);
    +         determine_line_heat(ent, &default_color);
    +       + trace2_region_enter("blame", "determine_line_heat", the_repository);
    +
    +    Then, running `git blame` for "kernel/fork.c" in linux.git and summing
    +    all the execution time for every call (around 1.3k calls) resulted in
    +    2.6x faster execution (best out 3):
    +
    +       git built from 328c109303 (The eighth batch, 2021-02-12) = 42ms
    +       git built from 328c109303 + this change                  = 16ms
    +
         Signed-off-by: Rafael Silva <rafaeloliveira.cs@gmail.com>
     
      ## builtin/blame.c ##
-- 
2.30.1.850.g2d41e9e789
Previous: Rafael SilvaNext: Rafael Silva
Message 8 of 9 in “blame: remove unnecessary use of get_commit_info()”
  1. 0/1 blame: remove unnecessary use of get_commit_info()Rafael Silva, Feb 16, 2021
  2. 1/1 blame: remove unnecessary use of get_commit_info()Rafael Silva, Feb 16, 2021
  3. Taylor BlauFeb 16, 2021
  4. Rafael SilvaFeb 16, 2021
  5. Derrick StoleeFeb 16, 2021
  6. Junio C HamanoFeb 16, 2021
  7. Rafael SilvaFeb 17, 2021
  8. 0/1 blame: remove unnecessary use of get_commit_info()Rafael Silva, Feb 17, 2021
  9. 1/1 blame: remove unnecessary use of get_commit_info()Rafael Silva, Feb 17, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.