{"thread":{"id":"55154","subject":"[PATCH 0/1] blame: remove unnecessary use of get_commit_info()","startedAt":"2021-02-16T16:33:52Z","lastAt":"2021-02-17T14:56:29Z","messageCount":9,"participants":["Rafael Silva","Taylor Blau","Derrick Stolee","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"417072","messageId":"20210216163151.76307-1-rafaeloliveira.cs@gmail.com","threadId":"55154","inReplyTo":null,"subject":"[PATCH 0/1] blame: remove unnecessary use of get_commit_info()","fromName":"Rafael Silva","fromEmail":"rafaeloliveira.cs@gmail.com","sentAt":"2021-02-16T16:31:50Z","receivedAt":"2021-02-16T16:33:52Z","isPatch":true,"sender":{"key":"rafaeloliveira.cs@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5935135?v=4"},"body":"This patch is a code cleanup and consequently a micro optimization in\ndetermine_heat_line().\n\nWhen `blame`ing with --color-by-age, the determine_line_heat() calls the\nget_commit_info() to parse the commit's information.  However, it turns\nout this is actually unnecessary because its caller also does the same.\nWe can instead, pass the already parsed `commit_info` and remove the\ninternal call to get_commit_info().\n\nThe performance optimization made by this patch is relatively small as\nget_commit_info() doesn't perform any heavy-load operations. So, the\nperformance improvements is not that exciting, not at least until you\nenter the ms/μs realm.  Nevertheless I thought the code cleanup is\nstill valid and the optimization is a bonus.\n\n\n  ... digging into the the performance improvements, for those \n      who are curious ...\n\nRunning Git PERF suite in linux.git, I've got a subtle performance\nimprovement for some runs:\n\n\t# git.328c109303 - compiled git from commit 328c109303\n\t# git.blame-patched - compiled git from commit 328c109303 + this patch\n        Test                                          git.328c109303    git.blame-patched\n        -------------------------------------------------------------------------------------\n        blame --color-by-age kernel/fork.c            1.96(1.81+0.15)   1.95(1.80+0.14) -0.5%\n        blame --color-by-age kernel/sys.c             1.67(1.53+0.13)   1.66(1.52+0.14) -0.6%\n        blame --color-by-age mm/slab.c                2.16(2.00+0.16)   2.15(1.99+0.15) -0.5%\n        blame --color-by-age lib/packing.c            0.20(0.14+0.05)   0.20(0.14+0.05) +0.0%\n        blame --color-by-age drivers/cdrom/cdrom.c    1.62(1.46+0.15)   1.62(1.46+0.15) +0.0%\n        blame --color-by-age crypto/crypto_engine.c   0.37(0.29+0.06)   0.36(0.28+0.06) -2.7%\n        blame --color-by-age net/ipv4/ip_forward.c    1.49(1.35+0.13)   1.48(1.34+0.13) -0.7%\n\nTo dig a little deeper, I enabled the Git's trace2 API to record every\ncall to the determine_line_heat() function:\n\n        ...\n+       trace2_region_enter(\"blame\", \"determine_line_heat\", the_repository);\n        determine_line_heat(ent, &default_color);\n+       trace2_region_enter(\"blame\", \"determine_line_heat\", the_repository);\n        ...\n\nThen, running `blame` for \"kernel/fork.c` and _summing_ all the execution\ntime for every call (around 1.3k calls) resulted in 2.6x faster execution\n(best out 3):\n\n\tgit built from 328c109303 (The eighth batch, 2021-02-12) = 42ms\n\tgit built from 328c109303 + this patch                   = 16ms\n\nOf course, this is on the milliseconds :).\n\nLastly, to get a better picture of the performance change, I computed\nall the determine_line_heat()'s execution time, for all 3 calls, into\na distribution graph.  The execution time is converted to microseconds\nfor ease of understanding:\n\n        # git built from 328c109303 (The eighth batch, 2021-02-12)\n     \tTime in μs     0.0 ~  9.0  |\n     \tTime in μs    10.0 ~ 19.0  | *\n     \tTime in μs    20.0 ~ 29.0  | *****************\n    \tTime in μs    30.0 ~ 39.0  | *****************\n     \tTime in μs    40.0 ~ 49.0  | **\n     \tTime in μs    50.0 ~ 59.0  | *\n     \tTime in μs    60.0 ~ 69.0  | *\n     \tTime in μs    70.0 ~ 79.0  | *\n     \tTime in μs    80.0 ~ 89.0  | *\n     \tTime in μs    90.0 ~ 99.0  | *\n     \tTime in μs   100.0 ~ 109.0 | *\n     \tTime in μs   110.0 ~ 119.0 | *\n     \tTime in μs   120.0 ~ 129.0 |\n     \tTime in μs   130.0 ~ 139.0 | *\n     \t[N: 3915 | Median: 30.0 | Min: 19.0 | Max: 137.0]\n\n     \t# git built from 328c109303 + this patch\n     \tTime in μs     0.0 ~  9.0  |\n     \tTime in μs    10.0 ~ 19.0  | *************************************\n     \tTime in μs    20.0 ~ 29.0  | *\n     \tTime in μs    30.0 ~ 39.0  | *\n     \tTime in μs    40.0 ~ 49.0  | *\n     \tTime in μs    50.0 ~ 59.0  | *\n     \tTime in μs    60.0 ~ 69.0  | *\n     \tTime in μs    70.0 ~ 79.0  | *\n     \tTime in μs    80.0 ~ 89.0  | *\n     \tTime in μs    90.0 ~ 99.0  |\n\t        ... [ zero's omitted ] ...\n     \tTime in μs   150.0 ~ 159.0 |\n     \tTime in μs   160.0 ~ 169.0 | *\n     \t[N: 3915 | Median: 12.0 | Min: 10.0 | Max: 167.0]\n\n\tNote: A \"*\" represent hundreds counter. One \"*\" is used\n\tfor any count between 1 and 99. (i.e: 23 = \"*\", 99 = \"*\",\n\t100 = \"**\", 199 = \"**\", 200 = \"***\", etc).\n\nWith the changes introduced by this patch, the determine_line_heat()\nmostly finishes its execution between 10μs and 19μs compared with the\ncurrent implementation that mostly finished around 20μs and 39μs.\n\nRafael Silva (1):\n  blame: remove unnecessary use of get_commit_info()\n\n builtin/blame.c | 8 +++-----\n 1 file changed, 3 insertions(+), 5 deletions(-)\n\n-- \n2.30.1.842.gf6373b1729\n"},{"id":"417073","messageId":"20210216163151.76307-2-rafaeloliveira.cs@gmail.com","threadId":"55154","inReplyTo":"20210216163151.76307-1-rafaeloliveira.cs@gmail.com","subject":"[PATCH 1/1] blame: remove unnecessary use of get_commit_info()","fromName":"Rafael Silva","fromEmail":"rafaeloliveira.cs@gmail.com","sentAt":"2021-02-16T16:31:51Z","receivedAt":"2021-02-16T16:34:30Z","isPatch":true,"sender":{"key":"rafaeloliveira.cs@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5935135?v=4"},"body":"When `git blame --color-by-age`, the determine_line_heat() is called to\nselect how to color the output based on the commit author's date.  It\nuses the get_commit_info() to parse the information into a `commit_info`\nstructure, however, this is actually unnecessary because the\ndetermine_line_heat() caller also does the same.\n\nInstead, let's change determine_line_heat() to take a `commit_info`\nstructure and remove the internal call to get_commit_info() thus\ncleaning up and micro-optimizing the code path.\n\nSigned-off-by: Rafael Silva <rafaeloliveira.cs@gmail.com>\n---\n builtin/blame.c | 8 +++-----\n 1 file changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex b66e938022..641523ff9a 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -425,13 +425,11 @@ static void setup_default_color_by_age(void)\n \tparse_color_fields(\"blue,12 month ago,white,1 month ago,red\");\n }\n \n-static void determine_line_heat(struct blame_entry *ent, const char **dest_color)\n+static void determine_line_heat(struct commit_info *ci, const char **dest_color)\n {\n \tint i = 0;\n-\tstruct commit_info ci;\n-\tget_commit_info(ent->suspect->commit, &ci, 1);\n \n-\twhile (i < colorfield_nr && ci.author_time > colorfield[i].hop)\n+\twhile (i < colorfield_nr && ci->author_time > colorfield[i].hop)\n \t\ti++;\n \n \t*dest_color = colorfield[i].col;\n@@ -453,7 +451,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int\n \tcp = blame_nth_line(sb, ent->lno);\n \n \tif (opt & OUTPUT_SHOW_AGE_WITH_COLOR) {\n-\t\tdetermine_line_heat(ent, &default_color);\n+\t\tdetermine_line_heat(&ci, &default_color);\n \t\tcolor = default_color;\n \t\treset = GIT_COLOR_RESET;\n \t}\n-- \n2.30.1.842.gf6373b1729\n\n"},{"id":"417075","messageId":"YCv8nvJ6faO7esoj@nand.local","threadId":"55154","inReplyTo":"20210216163151.76307-2-rafaeloliveira.cs@gmail.com","subject":"Re: [PATCH 1/1] blame: remove unnecessary use of get_commit_info()","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-02-16T17:10:54Z","receivedAt":"2021-02-16T17:11:48Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Feb 16, 2021 at 05:31:51PM +0100, Rafael Silva wrote:\n> When `git blame --color-by-age`, the determine_line_heat() is called to\n> select how to color the output based on the commit author's date.  It\n> uses the get_commit_info() to parse the information into a `commit_info`\n> structure, however, this is actually unnecessary because the\n> determine_line_heat() caller also does the same.\n\nInteresting. It looks like this micro-optimization could have been\nsafely performed as early as 25d5f52901 (builtin/blame: highlight\nrecently changed lines, 2018-04-23), which is when this feature was\noriginally introduced.\n\nI looked at 25d5f52901 to see if there was any reason that we didn't at\nthe time, but couldn't find anything.\n\nSo this looks correct to me. I'm a little disappointed that some of\nyour more detailed performance numbers from the cover letter didn't make\nit into the patch description, but it may not be worth belaboring the\npoint further.\n\n    Reviewed-by: Taylor Blau <me@ttaylorr.com>\n\nThanks,\nTaylor\n"},{"id":"417085","messageId":"ce29b876-a5dd-76e9-bf79-5b917249b508@gmail.com","threadId":"55154","inReplyTo":"20210216163151.76307-1-rafaeloliveira.cs@gmail.com","subject":"Re: [PATCH 0/1] blame: remove unnecessary use of get_commit_info()","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2021-02-16T18:35:16Z","receivedAt":"2021-02-16T18:36:31Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 2/16/2021 11:31 AM, Rafael Silva wrote:\n> Running Git PERF suite in linux.git, I've got a subtle performance\n> improvement for some runs:\n> \n> \t# git.328c109303 - compiled git from commit 328c109303\n> \t# git.blame-patched - compiled git from commit 328c109303 + this patch\n>         Test                                          git.328c109303    git.blame-patched\n>         -------------------------------------------------------------------------------------\n>         blame --color-by-age kernel/fork.c            1.96(1.81+0.15)   1.95(1.80+0.14) -0.5%\n>         blame --color-by-age kernel/sys.c             1.67(1.53+0.13)   1.66(1.52+0.14) -0.6%\n>         blame --color-by-age mm/slab.c                2.16(2.00+0.16)   2.15(1.99+0.15) -0.5%\n>         blame --color-by-age lib/packing.c            0.20(0.14+0.05)   0.20(0.14+0.05) +0.0%\n>         blame --color-by-age drivers/cdrom/cdrom.c    1.62(1.46+0.15)   1.62(1.46+0.15) +0.0%\n>         blame --color-by-age crypto/crypto_engine.c   0.37(0.29+0.06)   0.36(0.28+0.06) -2.7%\n>         blame --color-by-age net/ipv4/ip_forward.c    1.49(1.35+0.13)   1.48(1.34+0.13) -0.7%\n\nHave you updated the commit-graph with changed-path Bloom filters in\nyour copy of linux.git before running the perf tests? You might get\nsmaller numbers overall (both sides) but make the difference for this\npatch be more pronounced:\n\n\tgit commit-graph write --reachable --changed-paths\n\n> To dig a little deeper, I enabled the Git's trace2 API to record every\n> call to the determine_line_heat() function:\n> \n>         ...\n> +       trace2_region_enter(\"blame\", \"determine_line_heat\", the_repository);\n>         determine_line_heat(ent, &default_color);\n> +       trace2_region_enter(\"blame\", \"determine_line_heat\", the_repository);\n>         ...\n> \n> Then, running `blame` for \"kernel/fork.c` and _summing_ all the execution\n> time for every call (around 1.3k calls) resulted in 2.6x faster execution\n> (best out 3):\n> \n> \tgit built from 328c109303 (The eighth batch, 2021-02-12) = 42ms\n> \tgit built from 328c109303 + this patch                   = 16ms\n\nThis is a good way to demonstrate the change. Definitely worthwhile for\ndemonstrating the value of the patch. I'll second Taylor's request that\nthis performance data goes in the commit message so we can see the details\nin the future.\n\nThanks,\n-Stolee\n"},{"id":"417098","messageId":"xmqqim6rpzjc.fsf@gitster.c.googlers.com","threadId":"55154","inReplyTo":"ce29b876-a5dd-76e9-bf79-5b917249b508@gmail.com","subject":"Re: [PATCH 0/1] blame: remove unnecessary use of get_commit_info()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-16T19:45:27Z","receivedAt":"2021-02-16T19:46:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Derrick Stolee <stolee@gmail.com> writes:\n\n> ...\n> This is a good way to demonstrate the change. Definitely worthwhile for\n> demonstrating the value of the patch. I'll second Taylor's request that\n> this performance data goes in the commit message so we can see the details\n> in the future.\n\nThanks, all.  I do agree with you and Taylor that these numbers\ndeserve to be in the log message, not cover letter.\n"},{"id":"417114","messageId":"gohp6kpn0z7j2b.fsf@cpm12071.fritz.box","threadId":"55154","inReplyTo":"YCv8nvJ6faO7esoj@nand.local","subject":"Re: [PATCH 1/1] blame: remove unnecessary use of get_commit_info()","fromName":"Rafael Silva","fromEmail":"rafaeloliveira.cs@gmail.com","sentAt":"2021-02-16T22:25:40Z","receivedAt":"2021-02-16T22:27:04Z","isPatch":true,"sender":{"key":"rafaeloliveira.cs@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5935135?v=4"},"body":"\nTaylor Blau <me@ttaylorr.com> writes:\n\n> On Tue, Feb 16, 2021 at 05:31:51PM +0100, Rafael Silva wrote:\n>> When `git blame --color-by-age`, the determine_line_heat() is called to\n>> select how to color the output based on the commit author's date.  It\n>> uses the get_commit_info() to parse the information into a `commit_info`\n>> structure, however, this is actually unnecessary because the\n>> determine_line_heat() caller also does the same.\n>\n> Interesting. It looks like this micro-optimization could have been\n> safely performed as early as 25d5f52901 (builtin/blame: highlight\n> recently changed lines, 2018-04-23), which is when this feature was\n> originally introduced.\n>\n> I looked at 25d5f52901 to see if there was any reason that we didn't at\n> the time, but couldn't find anything.\n>\n> So this looks correct to me. I'm a little disappointed that some of\n> your more detailed performance numbers from the cover letter didn't make\n> it into the patch description, but it may not be worth belaboring the\n> point further.\n>\n>     Reviewed-by: Taylor Blau <me@ttaylorr.com>\n>\n\nThanks for reviewing this patch.\n\nI wasn't sure whether adding the performance number into the patch was a\ngood idea or not.  After reading your message and the response from\nDerrick and Junio, I'll definitely re-roll this patch adding those\ninformation.\n\n> Thanks,\n> Taylor\n\n-- \nThanks\nRafael\n"},{"id":"417156","messageId":"gohp6k1rdf588m.fsf@cpm12071.fritz.box","threadId":"55154","inReplyTo":"ce29b876-a5dd-76e9-bf79-5b917249b508@gmail.com","subject":"Re: [PATCH 0/1] blame: remove unnecessary use of get_commit_info()","fromName":"Rafael Silva","fromEmail":"rafaeloliveira.cs@gmail.com","sentAt":"2021-02-17T14:42:09Z","receivedAt":"2021-02-17T14:43:24Z","isPatch":true,"sender":{"key":"rafaeloliveira.cs@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5935135?v=4"},"body":"\nDerrick Stolee <stolee@gmail.com> writes:\n\n> On 2/16/2021 11:31 AM, Rafael Silva wrote:\n>> Running Git PERF suite in linux.git, I've got a subtle performance\n>> improvement for some runs:\n>> \n>> \t# git.328c109303 - compiled git from commit 328c109303\n>> \t# git.blame-patched - compiled git from commit 328c109303 + this patch\n>>         Test                                          git.328c109303    git.blame-patched\n>>         -------------------------------------------------------------------------------------\n>>         blame --color-by-age kernel/fork.c            1.96(1.81+0.15)   1.95(1.80+0.14) -0.5%\n>>         blame --color-by-age kernel/sys.c             1.67(1.53+0.13)   1.66(1.52+0.14) -0.6%\n>>         blame --color-by-age mm/slab.c                2.16(2.00+0.16)   2.15(1.99+0.15) -0.5%\n>>         blame --color-by-age lib/packing.c            0.20(0.14+0.05)   0.20(0.14+0.05) +0.0%\n>>         blame --color-by-age drivers/cdrom/cdrom.c    1.62(1.46+0.15)   1.62(1.46+0.15) +0.0%\n>>         blame --color-by-age crypto/crypto_engine.c   0.37(0.29+0.06)   0.36(0.28+0.06) -2.7%\n>>         blame --color-by-age net/ipv4/ip_forward.c    1.49(1.35+0.13)   1.48(1.34+0.13) -0.7%\n>\n> Have you updated the commit-graph with changed-path Bloom filters in\n> your copy of linux.git before running the perf tests? You might get\n> smaller numbers overall (both sides) but make the difference for this\n> patch be more pronounced:\n>\n> \tgit commit-graph write --reachable --changed-paths\n>\n\nThanks for pointing this out. I didn't updated the commit-graph in my\ncopy of linux.git when I ran the perf tests and indeed with the\ncommit-graph updated, the execution time is faster now.\n\nHere's the results (best out of 3):\n\n        # git.328c109303 - compiled git from commit 328c109303\n        # git.blame-patched - compiled git from commit 328c109303 + this patch\n        Test                                          git.328c109303   git.blame-patched\n        ------------------------------------------------------------------------------------\n        blame --color-by-age kernel/fork.c            1.13(0.96+0.17)  1.12(0.96+0.15) -0.9%\n        blame --color-by-age kernel/sys.c             1.00(0.81+0.18)  0.98(0.81+0.15) -2.0%\n        blame --color-by-age mm/slab.c                1.51(1.33+0.18)  1.49(1.31+0.17) -1.3%\n        blame --color-by-age lib/packing.c            0.13(0.05+0.07)  0.12(0.04+0.07) -7.7%\n        blame --color-by-age drivers/cdrom/cdrom.c    0.62(0.48+0.12)  0.61(0.48+0.12) -1.6%\n        blame --color-by-age crypto/crypto_engine.c   0.16(0.08+0.08)  0.16(0.07+0.08) +0.0%\n        blame --color-by-age net/ipv4/ip_forward.c    0.43(0.30+0.13)  0.42(0.29+0.11) -2.3%\n\nFor the \"kernel/fork.c\" example, there is around 1.7x improvement. The\npercentage comparison is also bigger than it was before the commit-graph\nfile was updated with the changed paths Bloom Filter as you expected.\n\nFor the \"net/ipv4/ip_forward.c\" there a 3.4x improvements which I\nbelieve is the biggest one in my tests.\n\n-- \nThanks\nRafael\n"},{"id":"417157","messageId":"20210217145443.36764-1-rafaeloliveira.cs@gmail.com","threadId":"55154","inReplyTo":"20210216163151.76307-1-rafaeloliveira.cs@gmail.com","subject":"[PATCH v2 0/1] blame: remove unnecessary use of get_commit_info()","fromName":"Rafael Silva","fromEmail":"rafaeloliveira.cs@gmail.com","sentAt":"2021-02-17T14:54:42Z","receivedAt":"2021-02-17T14:56:20Z","isPatch":true,"sender":{"key":"rafaeloliveira.cs@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5935135?v=4"},"body":"Thanks Taylor, Derrick and Junio for reviewing v1. I've updated the\npatch's message to include one of the performance reports that was\npreviously only on the cover-letter as suggested.\n\nRafael Silva (1):\n  blame: remove unnecessary use of get_commit_info()\n\n builtin/blame.c | 8 +++-----\n 1 file changed, 3 insertions(+), 5 deletions(-)\n\nRange-diff against v1:\n1:  e0c698370e ! 1:  4d70ce9545 blame: remove unnecessary use of get_commit_info()\n    @@ Commit message\n         structure and remove the internal call to get_commit_info() thus\n         cleaning up and optimizing the code path.\n     \n    +    Enabling Git's trace2 API in order to record the execution time for\n    +    every call to determine_line_heat() function:\n    +\n    +       + trace2_region_enter(\"blame\", \"determine_line_heat\", the_repository);\n    +         determine_line_heat(ent, &default_color);\n    +       + trace2_region_enter(\"blame\", \"determine_line_heat\", the_repository);\n    +\n    +    Then, running `git blame` for \"kernel/fork.c\" in linux.git and summing\n    +    all the execution time for every call (around 1.3k calls) resulted in\n    +    2.6x faster execution (best out 3):\n    +\n    +       git built from 328c109303 (The eighth batch, 2021-02-12) = 42ms\n    +       git built from 328c109303 + this change                  = 16ms\n    +\n         Signed-off-by: Rafael Silva <rafaeloliveira.cs@gmail.com>\n     \n      ## builtin/blame.c ##\n-- \n2.30.1.850.g2d41e9e789\n\n"},{"id":"417158","messageId":"20210217145443.36764-2-rafaeloliveira.cs@gmail.com","threadId":"55154","inReplyTo":"20210217145443.36764-1-rafaeloliveira.cs@gmail.com","subject":"[PATCH v2 1/1] blame: remove unnecessary use of get_commit_info()","fromName":"Rafael Silva","fromEmail":"rafaeloliveira.cs@gmail.com","sentAt":"2021-02-17T14:54:43Z","receivedAt":"2021-02-17T14:56:29Z","isPatch":true,"sender":{"key":"rafaeloliveira.cs@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5935135?v=4"},"body":"When `git blame --color-by-age`, the determine_line_heat() is called to\nselect how to color the output based on the commit's author date.  It\nuses the get_commit_info() to parse the information into a `commit_info`\nstructure, however, this is actually unnecessary because the\ndetermine_line_heat() caller also does the same.\n\nInstead, let's change the determine_line_heat() to take a `commit_info`\nstructure and remove the internal call to get_commit_info() thus\ncleaning up and optimizing the code path.\n\nEnabling Git's trace2 API in order to record the execution time for\nevery call to determine_line_heat() function:\n\n   + trace2_region_enter(\"blame\", \"determine_line_heat\", the_repository);\n     determine_line_heat(ent, &default_color);\n   + trace2_region_enter(\"blame\", \"determine_line_heat\", the_repository);\n\nThen, running `git blame` for \"kernel/fork.c\" in linux.git and summing\nall the execution time for every call (around 1.3k calls) resulted in\n2.6x faster execution (best out 3):\n\n   git built from 328c109303 (The eighth batch, 2021-02-12) = 42ms\n   git built from 328c109303 + this change                  = 16ms\n\nSigned-off-by: Rafael Silva <rafaeloliveira.cs@gmail.com>\n---\n builtin/blame.c | 8 +++-----\n 1 file changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex b66e938022..641523ff9a 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -425,13 +425,11 @@ static void setup_default_color_by_age(void)\n \tparse_color_fields(\"blue,12 month ago,white,1 month ago,red\");\n }\n \n-static void determine_line_heat(struct blame_entry *ent, const char **dest_color)\n+static void determine_line_heat(struct commit_info *ci, const char **dest_color)\n {\n \tint i = 0;\n-\tstruct commit_info ci;\n-\tget_commit_info(ent->suspect->commit, &ci, 1);\n \n-\twhile (i < colorfield_nr && ci.author_time > colorfield[i].hop)\n+\twhile (i < colorfield_nr && ci->author_time > colorfield[i].hop)\n \t\ti++;\n \n \t*dest_color = colorfield[i].col;\n@@ -453,7 +451,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int\n \tcp = blame_nth_line(sb, ent->lno);\n \n \tif (opt & OUTPUT_SHOW_AGE_WITH_COLOR) {\n-\t\tdetermine_line_heat(ent, &default_color);\n+\t\tdetermine_line_heat(&ci, &default_color);\n \t\tcolor = default_color;\n \t\treset = GIT_COLOR_RESET;\n \t}\n-- \n2.30.1.850.g2d41e9e789\n\n"}]}