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

Re: Drastic jump in the time required for the test suite

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Oct 20, 2016, 17:13 UTC
Message-ID
<vpqinsnndtg.fsf@anie.imag.fr>
In-Reply-To
<xmqqmvhzhu6f.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> Are you proposing to replace the tests written as shell scripts with
> scripts in another language or framework that run equivalent
> sequences of git commands that is as portable as, if not more,
> Bourne shell?

The language (/bin/sh) is probably not the biggest issue. The way we use it may be.

I don't have benchmark to tell what slows down the testsuite, but for example we often write

	cat >expected <<EOF &&
	content
	EOF
	git foo >actual &&
	test_cmp expected actual

We create 2 files, fork one 'cat' and one 'diff'. Now, suppose we can write instead

	test_check_output git foo <<EOF
	content
	EOF

where test_check_output would be a compiled program running "git foo" with popen(), reading the expected output on stdin, and comparing both (and possibly creating files and forking 'diff', but only on the error path). That would reduce the overhead of test a lot: on fork+exec to create the "test_check_output" process + plain string comparison.

Obviously, I don't expect this change to drastically reduce the time (Peff's numbers seem to suggest that there's not so much to gain), but maybe getting a few C helpers and "optimized" idioms in our testsuite could lead to measurable improvements.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Duy Nguyen
Message 23 of 31 in “Drastic jump in the time required for the test suite”
  1. Johannes SchindelinOct 19, 2016
  2. Junio C HamanoOct 19, 2016
  3. Jeff KingOct 19, 2016
  4. Johannes SchindelinOct 20, 2016
  5. Jeff KingOct 20, 2016
  6. Stefan BellerOct 20, 2016
  7. Jeff KingOct 20, 2016
  8. Stefan BellerOct 20, 2016
  9. Jeff KingOct 20, 2016
  10. Jeff KingOct 20, 2016
  11. Johannes SixtOct 21, 2016
  12. Jeff KingOct 21, 2016
  13. Johannes SchindelinOct 20, 2016
  14. Jeff KingOct 20, 2016
  15. Stefan BellerOct 20, 2016
  16. Jeff KingOct 20, 2016
  17. Jeff KingOct 20, 2016
  18. Johannes SixtOct 20, 2016
  19. Jeff KingOct 20, 2016
  20. Dennis KaarsemakerOct 20, 2016
  21. Duy NguyenOct 21, 2016
  22. Junio C HamanoOct 20, 2016
  23. Matthieu MoyOct 20, 2016
  24. Duy NguyenOct 20, 2016
  25. René ScharfeOct 20, 2016
  26. Duy NguyenOct 21, 2016
  27. René ScharfeOct 21, 2016
  28. Matthieu MoyOct 21, 2016
  29. René ScharfeOct 21, 2016
  30. Eric WongOct 27, 2016
  31. Duy NguyenOct 28, 2016

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.