Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile compile and link performance #3518

Closed
waruqi opened this issue Mar 17, 2023 · 0 comments
Closed

Profile compile and link performance #3518

waruqi opened this issue Mar 17, 2023 · 0 comments

Comments

@waruqi
Copy link
Member

waruqi commented Mar 17, 2023

Profile compile and link

$ XMAKE_PROFILE=perf:tag xmake -r
[ 95%]: compiling.release src/demo/math/fixed.c
[ 95%]: compiling.release src/demo/libm/float.c
[ 96%]: compiling.release src/demo/libm/double.c
[ 96%]: compiling.release src/demo/other/test.cpp
[ 98%]: archiving.release libtbox.a
[ 99%]: linking.release demo
[100%]: build ok, spent 10.64s
 0.546,       1, clang: compile src/tbox/platform/fwatcher.c
 0.400,       1, clang: compile src/tbox/libc/stdio/vswprintf.c
 0.374,       1, clang: compile src/tbox/libc/stdio/vsnprintf.c
 0.347,       1, clang: compile src/tbox/platform/poller.c
 0.337,       1, clang: compile src/tbox/stream/stream.c
 0.312,       1, clang: compile src/demo/utils/bits.c
 0.264,       1, clang: compile src/tbox/stream/static_stream.c
 0.253,       1, clang: compile src/tbox/platform/thread_pool.c
 0.231,       1, clang: compile src/tbox/platform/socket.c
 0.178,       1, clang: compile src/tbox/network/cookies.c
 0.177,       1, clang: compile src/tbox/network/http.c
 0.169,       1, clang: compile src/tbox/platform/timer.c
 0.163,       1, clang: compile src/tbox/platform/file.c

Profile find_program, has_flags, find_file ...

 0.020,       1, find_program: zig
 0.020,       2, find_program: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefaul
t.xctoolchain/usr/bin/clang
 0.019,       1, has_flags: clang: -fPIC
 0.012,       1, clang: compile: /var/folders/32/w9cz0y_14hs19lkbs6v6_fm80000gn/T/.xmake501/2303
17/_2EB2C5E08EF94E7EBD1C7CF990F2A1F0.cpp
 0.006,       1, find_program: git
 0.004,       1, has_flags: clang: -fdiagnostics-color=always
 0.003,       1, find_programver: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDef
ault.xctoolchain/usr/bin/clang

Add custom profile point in custom rules

import("core.base.profiler")

profiler.enter("tag name", "arg1", "arg2")
-- TODO
profiler.leave("tag name", "arg1", "arg2")
time (s).  count
 0.163,       1, tag name: arg1 arg2
@waruqi waruqi added this to the v2.7.8 milestone Mar 17, 2023
@waruqi waruqi changed the title Profile performance Profile compile and link performance Mar 17, 2023
@waruqi waruqi closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant