Skip to content

Conversation

@apaszke
Copy link
Contributor

@apaszke apaszke commented Sep 17, 2018

To illustrate the benefits of this commit, I'll use the time/iter I got from one of the JIT benchmarks on my machine.

Run Time
No profiler 45ms
With profiler 56ms
Use clock_gettime instead of std::chrono 48ms
Touch all pages on block allocation 48ms (less jitter)
Use const char* instead of std::string 47ms (even less jitter)

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@apaszke
Copy link
Contributor Author

apaszke commented Sep 17, 2018

@pytorchbot retest this please


void pushRange(std::string name, const char* msg/*= ""*/, int64_t sequence_nr/*= -1*/) {
const char* c_str(const char *str) { return str; }
const char* c_str(const std::string& str) { return str.c_str(); }

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

std::string name_;
uint32_t thread_id_;
int64_t cpu_ns_; // signed to allow for negative intervals
std::unique_ptr<std::string> owned_name_;

This comment was marked as off-topic.

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okey-dokey

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants