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

Add: Chrono based TIC() and TOC() in debug #7306

Merged
merged 2 commits into from Mar 9, 2019

Conversation

GabdaZM
Copy link
Contributor

@GabdaZM GabdaZM commented Mar 2, 2019

It is a copy of the existing TIC and TOC functions, but the output is in microseconds.
It might be less accurate than the CPU tic count, but it is easier to relate to the output.

@GabdaZM
Copy link
Contributor Author

GabdaZM commented Mar 2, 2019

Cleanup added: changing double underscore variable names to have single underscore.

@nielsmh
Copy link
Contributor

nielsmh commented Mar 2, 2019

Could I request a clarification in the comment for the old TIC/TOC that the value output by those is not a standard measurement comparable across machines? I.e. that the value is defined by the CPU used to run the code, and they are mainly useful for measuring the effect of local optimisations.

Copy link
Member

@TrueBrain TrueBrain left a comment

Choose a reason for hiding this comment

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

As per @nielsmh request :)

@michicc
Copy link
Member

michicc commented Mar 3, 2019

Typo in first commit message: "duble".

@GabdaZM
Copy link
Contributor Author

GabdaZM commented Mar 3, 2019

@nielsmh: I think it is true for the chrono based measurement as well, that it is not a standard measurement, and depends on the CPU speed. As I do not see what the original tic and toc do, I need some help to phrase the difference if you want me to include it in the documentation.

@PeterN
Copy link
Member

PeterN commented Mar 3, 2019

Chrono measurement should be in micro or milli seconds. That's the standard measurement referred to.

RDTSC is in CPU cycles which doesn't translate to real time at all, just CPU workload. This is what he is getting at.

@michicc
Copy link
Member

michicc commented Mar 3, 2019

Sorry: "duoble".

@GabdaZM
Copy link
Contributor Author

GabdaZM commented Mar 3, 2019

Sorry: "duoble".

Thanks for noticing! An imp must have nested in my commig-msg-hook, I will look into it.

@nielsmh nielsmh merged commit 7e7563f into OpenTTD:master Mar 9, 2019
@GabdaZM GabdaZM deleted the chrono_tic_toc branch March 11, 2019 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants