Re: [PATCH] pretty: lazy-load commit data when expanding user-format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 28 2021, Jeff King wrote:

>   # using git.git as the test repo
>   Test                          HEAD^             HEAD
>   ----------------------------------------------------------------------
>   4205.1: log with %H           0.40(0.39+0.01)   0.03(0.02+0.01) -92.5%
>   4205.2: log with %h           0.45(0.44+0.01)   0.09(0.09+0.00) -80.0%
>   4205.3: log with %T           0.40(0.39+0.00)   0.04(0.04+0.00) -90.0%
>   4205.4: log with %t           0.46(0.46+0.00)   0.09(0.08+0.01) -80.4%
>   4205.5: log with %P           0.39(0.39+0.00)   0.03(0.03+0.00) -92.3%
>   4205.6: log with %p           0.46(0.46+0.00)   0.10(0.09+0.00) -78.3%
>   4205.7: log with %h-%h-%h     0.52(0.51+0.01)   0.15(0.14+0.00) -71.2%
>   4205.8: log with %an-%ae-%s   0.42(0.41+0.00)   0.42(0.41+0.01) +0.0%

Looks nice!

> diff --git a/t/perf/p4205-log-pretty-formats.sh b/t/perf/p4205-log-pretty-formats.sh
> index 7c26f4f337..609fecd65d 100755
> --- a/t/perf/p4205-log-pretty-formats.sh
> +++ b/t/perf/p4205-log-pretty-formats.sh
> @@ -6,7 +6,7 @@ test_description='Tests the performance of various pretty format placeholders'
>  
>  test_perf_default_repo
>  
> -for format in %H %h %T %t %P %p %h-%h-%h
> +for format in %H %h %T %t %P %p %h-%h-%h %an-%ae-%s
>  do
>  	test_perf "log with $format" "
>  		git log --format=\"$format\" >/dev/null


While we're at it it would be nice to have a few more formats that have
to do with the body in some way in those tests, and stess things like
mailmap/trailers etc.

    %s
    %b
    %B
    %N
    %aN-%aE
    %cn-%ce
    %cN-%cE
    %d
    %D
    %(trailers)

Just paging over the git-log manpage, that seems to stress most of the
codepaths, i.e. subject/body, but also things like notes, .mailmap, ref
names, and body parsing (trailers).



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux