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

Re: [PATCH v2] rev-list --disk-usage

From
Taylor Blau <me@ttaylorr.com>
Date
Feb 10, 2021, 01:49 UTC
Message-ID
<YCM7t3buBR6sL/lh@nand.local>
In-Reply-To
<xmqqh7mkycno.fsf@gitster.c.googlers.com>
On Tue, Feb 09, 2021 at 04:44:27PM -0800, Junio C Hamano wrote:
Show 11 quoted lines
> Jeff King <peff@peff.net> writes:
>
> > Here's a re-roll of my series to add "rev-list --disk-usage", for
> > counting up object storage used for various slices of history.
> > ...
> >  t/t6114-rev-list-du.sh             | 51 +++++++++++++++++++
> >  t/test-lib-functions.sh            |  9 +++-
> >  7 files changed, 199 insertions(+), 8 deletions(-)
> >  create mode 100755 t/t6114-rev-list-du.sh
>
> I relocated 6114 to 6115 to avoid tests sharing the same number.
Thanks.
Show 15 quoted lines
> I am getting these numbers from random ranges I am interested in,
> but do they say what I think they mean?  Was the development effort
> went into the v2.28 release almost half the size of v2.29, and have
> we already done about the same amont of work for this cycle?
>
> : gitster git.git/seen; rungit seen rev-list --disk-usage master..next
> 83105
> : gitster git.git/seen; rungit seen rev-list --disk-usage v2.30.0..master
> 183463
> : gitster git.git/seen; rungit seen rev-list --disk-usage v2.29.0..v2.30.0
> 231640
> : gitster git.git/seen; rungit seen rev-list --disk-usage v2.28.0..v2.29.0
> 334355
> : gitster git.git/seen; rungit seen rev-list --disk-usage v2.27.0..v2.28.0
> 182298

I think you are surprised by these numbers because you're only counting disk usage of commit objects in those ranges. v1 of this series implied --objects by default, but this changed in v2 due to my suggestion.

Passing --objects to count the disk-usage of all objects in those ranges gives more reasonable numbers (and match my rough guesses, i.e., that 2.29 was busier than 2.30, and so on):

    $ for range in origin/master..origin/next v2.30.0..origin/master \
        v2.29.0..v2.30.0 v2.28.0..v2.29.0 v2.27.0..v2.28.0
    do
      printf "%s %d vs. %d\n" $range \
        "$(git rev-list --objects --no-object-names $range |
           git cat-file --batch-check='%(objectsize:disk)' |
           paste -sd+ | bc)" \
        "$(git.seen rev-list --objects --disk-usage $range)"
    done
    origin/master..origin/next 671380 vs. 671380
    v2.30.0..origin/master 1618815 vs. 1618815
    v2.29.0..v2.30.0 3308295 vs. 3308295
    v2.28.0..v2.29.0 4080789 vs. 4080789
    v2.27.0..v2.28.0 2846196 vs. 2846196

Thanks, Taylor

Previous: Junio C HamanoNext: Jeff King
Message 19 of 30 in “rev-list --disk-usage”
  1. 0/2 rev-list --disk-usageJeff King, Jan 27, 2021
  2. 1/2 t: add --no-tag option to test_commitJeff King, Jan 27, 2021
  3. Taylor BlauJan 27, 2021
  4. 2/2 rev-list: add --disk-usage option for calculating disk usageJeff King, Jan 27, 2021
  5. Taylor BlauJan 27, 2021
  6. Jeff KingJan 27, 2021
  7. Eric SunshineJan 27, 2021
  8. Jeff KingJan 27, 2021
  9. Kyle MeyerJan 27, 2021
  10. Jeff KingJan 27, 2021
  11. Taylor BlauJan 27, 2021
  12. rev-list --disk-usageJeff King, Feb 9, 2021
  13. 1/2 t: add --no-tag option to test_commitJeff King, Feb 9, 2021
  14. 2/2 rev-list: add --disk-usage option for calculating disk usageJeff King, Feb 9, 2021
  15. Jeff KingFeb 9, 2021
  16. Junio C HamanoFeb 9, 2021
  17. Jeff KingFeb 10, 2021
  18. Junio C HamanoFeb 10, 2021
  19. Taylor BlauFeb 10, 2021
  20. Jeff KingFeb 10, 2021
  21. Junio C HamanoFeb 10, 2021
  22. Jeff KingFeb 10, 2021
  23. Taylor BlauFeb 10, 2021
  24. Jeff KingFeb 11, 2021
  25. Ævar Arnfjörð BjarmasonFeb 11, 2021
  26. Junio C HamanoFeb 11, 2021
  27. 0/2 rev-list --disk-usage example docsJeff King, Feb 17, 2021
  28. 1/2 docs/rev-list: add an examples sectionJeff King, Feb 17, 2021
  29. 2/2 docs/rev-list: add some examples of --disk-usageJeff King, Feb 17, 2021
  30. Taylor BlauFeb 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.