Avoid to run profiling code in critical stack completely if there is no need#245
Merged
Avoid to run profiling code in critical stack completely if there is no need#245
Conversation
Member
|
Is this PR really needed? Isn't there another PR #197 |
jywu-msft
requested changes
Dec 22, 2018
Member
Author
|
@jywu-msft we do need this PR because PR #197 and previous PR #166 doesn't solve the problem completely. There is still overhead for profiling. I make a change without build option. |
jywu-msft
reviewed
Jan 1, 2019
jywu-msft
approved these changes
Jan 1, 2019
| auto graph_viewer = session_state.GetGraphViewer(); | ||
| TimePoint sync_time_begin; | ||
| TimePoint kernel_begin_time; | ||
| bool f_profiler_enabled = session_state.Profiler().FEnabled(); |
Member
There was a problem hiding this comment.
bool profiler_enabled = session_state.Profiler().Enabled() reads better?
Member
Author
There was a problem hiding this comment.
same with the function name, f means flag here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With build_essential option, it runs 0.2ms faster for agi-encoder model (total cost 1.6ms ).