Would our benevolent dictator(s) accept a patch to change ninja to show the relative timestamp + duration of each commands like run_test_cases does? The benefits are:
- Quickly determine the slowest operations, like linking.
- Quickly find when the build process was effectively hung with the help of the relative timestamp of each output, for example by disk I/O contention.
The output could be controlled by either:
- output is redirected to a file/pipe instead of a console
- with a new flag
- just enable the new format all the time
I don't know which you would prefer so that's why I'm asking before any implementation.
Faked example of the proposed output:
[ 1/2686] 0.97s CXX obj/base/base.hi_res_timer_manager_posix.o (0.97s)
[ 2/2686] 2.36s CXX obj/base/json/base.json_file_value_serializer.o (1.39s)
[ 3/2686] 2.46s CXX obj/base/json/base.json_parser.o (2.45s)
[ 4/2686] 2.46s CXX obj/base/json/base.json_writer.o (2.45s)
[ 5/2686] 2.46s CXX obj/base/base.lazy_instance.o (2.45s)
[ 6/2686] 4.08s CXX obj/base/base.location.o (1.63s)
[ 7/2686] 4.25s CXX obj/base/base.logging.o (1.89s)
[ 8/2686] 4.35s CXX obj/base/memory/base.ref_counted.o (1.90s)
First timestamp column is the relative timestamp at which the message was printed, the last number is the duration of this single step.
Thanks,
M-A