tree: 3193932178f941dc8dbdbf5c44568cecd9e14ad3 [path history] [tgz]
  1. config/
  2. meta/
  3. assert.h
  4. async_loop.cc
  5. async_loop.fidl
  6. atomics.cc
  7. BUILD.gn
  8. channels.cc
  9. clock.cc
  10. clock_posix.cc
  11. context_switch_overhead.cc
  12. context_switch_overhead_helper.cc
  13. events.cc
  14. example.cc
  15. fdio_spawn.cc
  16. fifos.cc
  17. filesystem.cc
  18. fork.cc
  19. get_info.cc
  20. get_info_helper.cc
  21. getpid.cc
  22. handle.cc
  23. handle_creation.cc
  24. inspect.cc
  25. lazy_dir.cc
  26. main.cc
  27. main.h
  28. malloc.cc
  29. mem_alloc.cc
  30. memcpy.cc
  31. mmu.cc
  32. mutex.cc
  33. no_op_executable.cc
  34. null.cc
  35. object_wait.cc
  36. OWNERS
  37. ports.cc
  38. prng.cc
  39. process_spawn_posix.cc
  40. pseudo_dir.cc
  41. pthreads.cc
  42. random_memcpy.cc
  43. README.md
  44. restricted_enter.cc
  45. round_tripper.fidl
  46. round_trips.cc
  47. round_trips.h
  48. round_trips_futex.cc
  49. round_trips_posix.cc
  50. scoped_mapping.h
  51. simple_latch.h
  52. sleep.cc
  53. sockets.cc
  54. starnix_filesystem.cc
  55. stdcompat.cc
  56. streams.cc
  57. syscalls.cc
  58. test_runner.h
  59. threads.cc
  60. timer.cc
  61. tracing.cc
  62. util.cc
  63. util.h
  64. vmar.cc
  65. vmo.cc
src/tests/microbenchmarks/README.md

Fuchsia Microbenchmarks

This set of tests includes microbenchmarks for core OS functionality, including Zircon syscalls and IPC primitives, as well as microbenchmarks for other layers of Fuchsia.

Some of the microbenchmarks are portable and can be run on Linux or Mac, for comparison against Fuchsia. This means that the name fuchsia_microbenchmarks should be taken to mean “microbenchmarks that are part of the Fuchsia project” rather than “microbenchmarks that only run on Fuchsia”.

This used to be called “zircon_benchmarks”, but it was renamed to reflect that it covers more than just Zircon.

Writing Benchmarks

This uses the perftest C++ library.

Running Benchmarks

fuchsia_microbenchmarks can be run the following ways:

  • Iterate on Single Benchmarks: If you want to run a smaller or faster set of tests, you can invoke the fuchsia_microbenchmarks component directly and pass some of the options accepted by the perftest C++ library.

    For example, the following invocation runs only the Syscall/Null test case and prints some summary statistics:

    fx test fuchsia_microbenchmarks.cm --output -- -p --filter '^Syscall/Null$'
    

    Alternatively, for machine readable results, the following invocation will produce an output file in fuchsiaperf.json format and will copy it back to the host in <host-output-dir>.

    fx test fuchsia_microbenchmarks.cm --output --ffx-output-directory <host-output-dir> -- -p --out /custom_artifacts/results.fuchsiaperf.json
    

    For the full list of options, run:

    fx test fuchsia_microbenchmarks.cm -- --help
    
  • Maximal: This approach uses the same end to end host test setup as Infra builds on CI and CQ. This runs the full suite multiple times, then outputs the results in fuchsiaperf.json files which can be post processed for the results.

    For this, you'll need some additional setup. Follow the instructions in How to run performance tests and use this command:

    fx test --e2e fuchsia_microbenchmarks_test
    

    This will take some time because it runs the fuchsia_microbenchmarks process multiple times.

    This entry point will copy the performance results (*.fuchsiaperf.json files) back to the host in the out/test_out directory.

  • Minimal: Unit test mode. To check that the tests pass, without collecting any performance results, you can run the fuchsia_microbenchmarks component directly:

    fx test fuchsia_microbenchmarks.cm
    

    This will quickly run a small number of iterations of each benchmark to verify that they run successfully.