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 consistent progress bars for syncing #7212

Merged
merged 22 commits into from
Jun 26, 2024
Merged

Add consistent progress bars for syncing #7212

merged 22 commits into from
Jun 26, 2024

Conversation

benaadams
Copy link
Member

@benaadams benaadams commented Jun 22, 2024

Changes

  • Rather than just Snap having a progress bar; also have progress bar for Downloads, Old headers, Old Bodies and Old Receipts
  • Split each char of the progress bar into 8 elements for higher precision in same chars
    '⡀', '⡄', '⡆', '⡇', '⣇', '⣧', '⣷', '⣿'
  • Output multi-line branch sync logs a max of every 10 sec
  • If log to be output is same as previous log, skip it
  • Only output one line for sync change (Move "Sync mode changed" to Debug)
  • Bring block etc to first element on sync change log

Before
image

After
image

Types of changes

What types of changes does your code introduce?

  • Other: Logging

Testing

Requires testing

  • No

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

I wonder if we started using some Pool of StringBuilders instead of string interpolation, would we reduce memory allocations significantly?

src/Nethermind/Nethermind.Logging/Progress.cs Outdated Show resolved Hide resolved
src/Nethermind/Nethermind.Logging/Progress.cs Outdated Show resolved Hide resolved
@benaadams
Copy link
Member Author

I wonder if we started using some Pool of StringBuilders instead of string interpolation, would we reduce memory allocations significantly?

C#10 made string interpolation good https://devblogs.microsoft.com/dotnet/string-interpolation-in-c-10-and-net-6/

@benaadams benaadams requested a review from LukaszRozmej June 26, 2024 17:26
@benaadams benaadams merged commit 229bd6b into master Jun 26, 2024
68 checks passed
@benaadams benaadams deleted the progress-bars branch June 26, 2024 22:53
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.

2 participants