-
Notifications
You must be signed in to change notification settings - Fork 825
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
optimize of_include_copy #5978
optimize of_include_copy #5978
Conversation
Signed-off-by: daquexian <daquexian566@gmail.com>
先不合并,还有进一步的优化 |
Speed stats:
|
…_custom_target to add_custom_command so it will not always run Signed-off-by: daquexian <daquexian566@gmail.com>
…flow into optimize_of_include_copy
Signed-off-by: daquexian <daquexian566@gmail.com>
@@ -133,15 +115,23 @@ function(GENERATE_CFG_AND_PYBIND11_CPP SRCS HDRS PYBIND_SRCS ROOT_DIR) | |||
list(APPEND PY_CFG_ARGS "--proto_file_path=${FIL}") | |||
endforeach() | |||
|
|||
add_custom_target( | |||
generate_py_cfg | |||
add_custom_command( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_custom_target 总是 会运行,add_custom_command 只会在 DEPENDS 改变的时候运行
@@ -133,15 +115,23 @@ function(GENERATE_CFG_AND_PYBIND11_CPP SRCS HDRS PYBIND_SRCS ROOT_DIR) | |||
list(APPEND PY_CFG_ARGS "--proto_file_path=${FIL}") | |||
endforeach() | |||
|
|||
add_custom_target( | |||
generate_py_cfg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要通过 target dependency 来触发命令,因为它的 OUTPUT(${${HDRS}} ${${SRCS}} ${${PYBIND_SRCS}})会被某个 target 所包含,编译那个 target 的时候会自动执行命令
Signed-off-by: daquexian <daquexian566@gmail.com>
a9eb59e
to
daf6ab2
Compare
Signed-off-by: daquexian <daquexian566@gmail.com>
…flow into optimize_of_include_copy
CI failed, removing label automerge |
Signed-off-by: daquexian <daquexian566@gmail.com>
…flow into optimize_of_include_copy
Signed-off-by: daquexian <daquexian566@gmail.com>
…flow into optimize_of_include_copy
Signed-off-by: daquexian <daquexian566@gmail.com>
…rd party Signed-off-by: daquexian <daquexian566@gmail.com>
…flow into optimize_of_include_copy
Speed stats:
|
效果:
-DTHIRD_PARTY=OFF 时,在没有文件被修改的情况下运行 ninja oneflow_py 的时间从 36s 降低到了 1s,修改了单个 cpp 文件时的编译时间从 72s 降低到 46s