Skip to content

log: Use steady clock for bench logging - #26118

Merged
maflcko merged 2 commits into
bitcoin:masterfrom
maflcko:2209-ci-t-🎎
Oct 10, 2022

Hidden character warning

The head ref may contain hidden characters: "2209-ci-t-\ud83c\udf8e"
Merged

maflcko merged 2 commits into
bitcoin:masterfrom
maflcko:2209-ci-t-🎎

Conversation

@maflcko

@maflcko maflcko commented Sep 19, 2022

Copy link
Copy Markdown
Member

Instead of using 0.001 and similar constants to "convert" an int64_t to milliseconds, use the type-safe Ticks<> helper. Also, use steady clock instead of system clock, since the durations are used for benchmarking.

-BEGIN VERIFY SCRIPT-

 ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ':(exclude)src/versionbits.cpp') ; }

 ren nStart                 time_start
 ren nTimeStart             time_start
 ren nTimeReadFromDiskTotal time_read_from_disk_total
 ren nTimeConnectTotal      time_connect_total
 ren nTimeFlush             time_flush
 ren nTimeChainState        time_chainstate
 ren nTimePostConnect       time_post_connect
 ren nTimeCheck             time_check
 ren nTimeForks             time_forks
 ren nTimeConnect           time_connect
 ren nTimeVerify            time_verify
 ren nTimeUndo              time_undo
 ren nTimeIndex             time_index
 ren nTimeTotal             time_total
 ren nTime1                 time_1
 ren nTime2                 time_2
 ren nTime3                 time_3
 ren nTime4                 time_4
 ren nTime5                 time_5
 ren nTime6                 time_6

 ren nBlocksTotal num_blocks_total

 # Newline after semicolon
 perl -0777 -pi -e 's/; time_connect_total/;\n        time_connect_total/g' src/validation.cpp
 perl -0777 -pi -e 's/; time_/;\n    time_/g'                               src/validation.cpp

-END VERIFY SCRIPT-
@fanquake

Copy link
Copy Markdown
Member

Concept ACK

@DrahtBot

DrahtBot commented Sep 19, 2022 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #25830 (refactor: Replace m_params with chainman.GetParams() by aureleoules)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@jarolrod

Copy link
Copy Markdown
Contributor

concept ack

@fanquake fanquake left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK fabf1cd - validation bench output still looks sane.

@maflcko
maflcko merged commit 2397574 into bitcoin:master Oct 10, 2022
@maflcko
maflcko deleted the 2209-ci-t-🎎 branch October 10, 2022 10:03
@bitcoin bitcoin locked and limited conversation to collaborators Oct 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants