[PATCH] D133153: [support] Prepare TimeProfiler for cross-thread support

Mark Shields via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 11:20:25 PDT 2022


mbs-modular added a comment.

This is very disturbing!

On my ubuntu box, with Release build:
CMD="/home/mbs/github/mbs-llvm-project/build/bin/clang++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/mbs/github/mbs-llvm-project/build/lib/Support -I/home/mbs/github/mbs-llvm-project/llvm/lib/Support -I/home/mbs/github/mbs-llvm-project/build/include -I/home/mbs/github/mbs-llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=global-constructors -O3 -DNDEBUG -std=c++17  -fno-exceptions -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/TimeProfiler.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/TimeProfiler.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/TimeProfiler.cpp.o -c /home/mbs/github/mbs-llvm-project/llvm/lib/Support/TimeProfiler.cpp"

for i in {1..5}; do /usr/bin/time -f "%e" $CMD; done

vs

for i in {1..5}; do /usr/bin/time -f "%e" $CMD -ftime-trace; done

Shows a consistent x1.03 slowdown for clang-14, my HEAD (94c6dfbaebbd5b9474794b2437757dfb6aedefc3 <https://reviews.llvm.org/rG94c6dfbaebbd5b9474794b2437757dfb6aedefc3>) and this branch (d94302069f893f0183fc3053255e287b5e7cc070).

That's comparable to the variance I see between individual runs. So I think it's in the noise for me.

Possibilities:

- Accidentally changed the clock.
- Despite all the profile writing code not depending on raw_pwrite_stream statically, there's some magic that saves profile writing time
- I'm not looking at a large enough run.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133153/new/

https://reviews.llvm.org/D133153



More information about the llvm-commits mailing list