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

Re: [PATCH v3 0/5] meson: wire up support for benchmarks

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 24, 2025, 04:31 UTC
Message-ID
<aAm-pcIfrFt6mjlV@pks.im>
In-Reply-To
<CAP8UFD1zqAk1_Y0ECu4=iyeF4k4LagfLgHWkEr8iz8ZnwkVT8A@mail.gmail.com>
On Wed, Apr 23, 2025 at 04:44:20PM +0200, Christian Couder wrote:
Show 32 quoted lines
> On Tue, Apr 22, 2025 at 9:53 AM Patrick Steinhardt <ps@pks.im> wrote:
> >
> > On Tue, Apr 22, 2025 at 09:27:57AM +0200, Christian Couder wrote:
> 
> > > In https://lore.kernel.org/git/CAP8UFD2jKwYzmc40knXY7k+FQabjZbGTqs9fowF=-0OqfNYp_w@mail.gmail.com/
> > > I wrote:
> > >
> > > "I wonder what happens when we run `meson test -C build --benchmark`
> > > but 'time' is not found."
> > >
> > > because I wasn't sure if it would just do nothing in that case which
> > > might not be very user friendly.
> >
> > Ah, sorry, forgot to answer that question. What Meson does in that case
> > is to print "No tests defined". We could help improve usability a bit by
> > printing benchmarks as part of the auto-detected features after setup of
> > the build directory has finished. That would make it more discoverable
> > that benchmarks have been disabled.
> 
> I was more expecting something simple like:
> 
> if time.found()
>   ...
> else
>   error('Benchmarking requires the `time` command')
> endif
> 
> in the same way as in meson.build elsewhere we have things like:
> 
> if not msgfmt.found() and gettext_option.enabled()
>   error('Internationalization via libintl requires msgfmt')
> endif

But erroring out by default doesn't really feel nice to the general developer. I'd claim that 99% of the time, developers will only end up running the test suite, never the benchmarks. So the default should match that and not require GNU time to be available, if you ask me.

An alternative could be to have a 'benchmarks' feature option wired up. This feature would be set to 'auto', and then we can detect time like this:

    time = find_program('time', dirs: program_path, required: get_option('benchmarks'))

This will then auto-enable or -disable the feature depending on the availability of GNU time. But if the user passes `-Dbenchmarks=enabled`, we would fail the setup in case the program wasn't found.

Patrick
Previous: Christian CouderNext: Christian Couder
Message 39 of 62 in “meson: wire up support for benchmarks”
  1. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Mar 31, 2025
  2. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Mar 31, 2025
  3. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Mar 31, 2025
  4. Toon ClaesApr 10, 2025
  5. Patrick SteinhardtApr 14, 2025
  6. Junio C HamanoApr 14, 2025
  7. Patrick SteinhardtApr 15, 2025
  8. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Mar 31, 2025
  9. Toon ClaesApr 10, 2025
  10. Toon ClaesApr 14, 2025
  11. Patrick SteinhardtApr 14, 2025
  12. 4/5 meson: wire up benchmarksPatrick Steinhardt, Mar 31, 2025
  13. Toon ClaesApr 10, 2025
  14. Patrick SteinhardtApr 14, 2025
  15. Toon ClaesApr 14, 2025
  16. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Mar 31, 2025
  17. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Apr 14, 2025
  18. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Apr 14, 2025
  19. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Apr 14, 2025
  20. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Apr 14, 2025
  21. Christian CouderApr 20, 2025
  22. Patrick SteinhardtApr 22, 2025
  23. 4/5 meson: wire up benchmarksPatrick Steinhardt, Apr 14, 2025
  24. Christian CouderApr 20, 2025
  25. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Apr 14, 2025
  26. Junio C HamanoApr 15, 2025
  27. Junio C HamanoApr 15, 2025
  28. Patrick SteinhardtApr 16, 2025
  29. Junio C HamanoApr 18, 2025
  30. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Apr 22, 2025
  31. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Apr 22, 2025
  32. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Apr 22, 2025
  33. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Apr 22, 2025
  34. 4/5 meson: wire up benchmarksPatrick Steinhardt, Apr 22, 2025
  35. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Apr 22, 2025
  36. Christian CouderApr 22, 2025
  37. Patrick SteinhardtApr 22, 2025
  38. Christian CouderApr 23, 2025
  39. Patrick SteinhardtApr 24, 2025
  40. Christian CouderApr 24, 2025
  41. Junio C HamanoApr 24, 2025
  42. Patrick SteinhardtApr 24, 2025
  43. Toon ClaesApr 23, 2025
  44. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Apr 25, 2025
  45. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Apr 25, 2025
  46. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Apr 25, 2025
  47. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Apr 25, 2025
  48. 4/5 meson: wire up benchmarksPatrick Steinhardt, Apr 25, 2025
  49. Christian CouderApr 25, 2025
  50. Patrick SteinhardtApr 25, 2025
  51. Christian CouderApr 25, 2025
  52. Patrick SteinhardtApr 25, 2025
  53. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Apr 25, 2025
  54. Christian CouderApr 25, 2025
  55. Patrick SteinhardtApr 25, 2025
  56. Christian CouderApr 25, 2025
  57. 0/5 meson: wire up support for benchmarksPatrick Steinhardt, Apr 28, 2025
  58. 1/5 t/perf: fix benchmarks with alternate repo formatsPatrick Steinhardt, Apr 28, 2025
  59. 2/5 t/perf: use configured PERL_PATHPatrick Steinhardt, Apr 28, 2025
  60. 3/5 t/perf: fix benchmarks with out-of-tree buildsPatrick Steinhardt, Apr 28, 2025
  61. 4/5 meson: wire up benchmarksPatrick Steinhardt, Apr 28, 2025
  62. 5/5 meson: wire up benchmarking optionsPatrick Steinhardt, Apr 28, 2025

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.