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

Re: [PATCH] t1050-large: replace dd by test-genrandom

From
Jeff King <peff@peff.net>
Date
Jan 13, 2015, 22:38 UTC
Message-ID
<20150113223849.GA3144@peff.net>
In-Reply-To
<54B59D24.7030508@kdbg.org>
On Tue, Jan 13, 2015 at 11:33:08PM +0100, Johannes Sixt wrote:
> BTW, is it the incompressibility where the time is lost or lack of
> sparseness of the files? How does the timing change with this patch on
> top?

Oh, good call. It's the incompressibility. Which makes perfect sense. Once we copy the file into the object database, that copy is not sparse. But in the genrandom version, it _is_ a million times bigger. :)

With the patch below, my timings go back to ~0.7s (actually, they seem slightly _better_ on average than what is in "master" now, but there is quite a bit of run-to-run noise, so it may not be meaningful).

Show 17 quoted lines
> diff --git a/t/t1050-large.sh b/t/t1050-large.sh
> index f653121..9cf4e0e 100755
> --- a/t/t1050-large.sh
> +++ b/t/t1050-large.sh
> @@ -9,10 +9,10 @@ test_expect_success setup '
>  	# clone does not allow us to pass core.bigfilethreshold to
>  	# new repos, so set core.bigfilethreshold globally
>  	git config --global core.bigfilethreshold 200k &&
> -	test-genrandom seed1 2000000 >large1 &&
> +	printf "\0%2000000s" X >large1 &&
>  	cp large1 large2 &&
>  	cp large1 large3 &&
> -	test-genrandom seed2 2500000 >huge &&
> +	printf "\0%2500000s" Y >huge &&
>  	GIT_ALLOC_LIMIT=1500k &&
>  	export GIT_ALLOC_LIMIT
>  '

I think with this squashed in, I have no complaints at all about your patch.

-Peff
Previous: Johannes SixtNext: Junio C Hamano
Message 6 of 13 in “t1050-large: replace dd by test-genrandom”
  1. t1050-large: replace dd by test-genrandomJohannes Sixt, Jan 13, 2015
  2. Junio C HamanoJan 13, 2015
  3. Johannes SixtJan 13, 2015
  4. Jeff KingJan 13, 2015
  5. Johannes SixtJan 13, 2015
  6. Jeff KingJan 13, 2015
  7. Junio C HamanoJan 13, 2015
  8. Jeff KingJan 14, 2015
  9. Junio C HamanoJan 14, 2015
  10. t1050-large: generate large files without ddJohannes Sixt, Jan 14, 2015
  11. Jeff KingJan 14, 2015
  12. Johannes SixtJan 14, 2015
  13. Junio C HamanoJan 14, 2015

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.