Makefile profiling

后端 未结 7 755
温柔的废话
温柔的废话 2020-12-24 13:23

So I have this Makefile based build system that my users feel is working too slowly. For the sake of this question lets define performance as the time it takes make to figur

7条回答
  •  攒了一身酷
    2020-12-24 13:57

    It depends on what you try to measure and how complex your Makefiles are.

    If you just want to measure the parsing, invoke a trivial target without dependencies. But this doesn't work well if you have target-specific rules (e.g. due to the use of $(eval)).

    if you also want to measure the inferencing process (which I believe is much faster) I don't see a way to invoke make to achieve that.

    If you also want to include the forking of the shell that executes the commands, things become easy again: set $(SHELL) to something that surrounds the actual shell command execution with timing information.

    Another idea is to run the make source code itself under a profiler or to add timing messages.

提交回复
热议问题