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

Remove: rdtsc and TIC/TOC based on CPU ticks #11856

Merged
merged 1 commit into from Jan 21, 2024

Conversation

TrueBrain
Copy link
Member

Motivation / Problem

Looking over warnings from our CI / Release Job, I keep noticing it warns in some cases that there is no good RDTSC found. But, you need to know, RDTSC is only ever used during development, when adding TIC/TOC statements.

Further more, for a long time now we have a TICC/TOCC alternative, which uses std::chrono. It is not as precise as the RDTSC can be, but I think most of us have been using TICC/TOCC over TIC/TOC, as reporting in ms is much more natural than reports in some arbitrary unit.

Description

Remove RDTSC code, and rename TICC/TOCC to TIC/TOC (which is based on std::chrono).

This has no impact on the user. This is only relevant for developers.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Use TIC/TOC based on std::chrono instead. This information is also
easier to compare with others, as although it depends on CPU, it
means a bit more if "yours takes 4ms and mine takes 10ms".
@TrueBrain TrueBrain enabled auto-merge (squash) January 21, 2024 15:08
@TrueBrain TrueBrain merged commit fa8294e into OpenTTD:master Jan 21, 2024
19 checks passed
@TrueBrain TrueBrain deleted the deprecate-rdtsc branch February 11, 2024 19:19
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

2 participants