Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add time retrieval latency profile to CLI diagnostics #2844

Conversation

guilhermelawless
Copy link
Contributor

A slower clocksource can have significant impact on the performance of the node. I was faced with this issue in a laptop with unstable TSC which falls back to the slower HPET (almost two orders of magnitude slower).

The cause wasn't immediately apparent, only after profiling, so this PR adds a quick loop to --diagnostics to measure the latency in retrieving the current system time. The loop isn't optimized away even in O3. Only takes ~100ms total with TSC.

For reference:

  • System with TSC: 33 nanoseconds
  • System with HPET: 1300 nanoseconds

@guilhermelawless guilhermelawless added the debug Updates assisting with debugging and development efforts label Jul 14, 2020
@guilhermelawless guilhermelawless added this to the V22.0 milestone Jul 14, 2020
@guilhermelawless guilhermelawless self-assigned this Jul 14, 2020
@guilhermelawless guilhermelawless merged commit 4522434 into nanocurrency:develop Jul 16, 2020
@guilhermelawless guilhermelawless deleted the cli/diagnostics/time-latency branch July 16, 2020 12:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
debug Updates assisting with debugging and development efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants