Skip to content

Slow down the spinner a bit#419

Merged
marc-vanderwal merged 1 commit intozonemaster:developfrom
marc-vanderwal:feature/slower-spinner
May 27, 2025
Merged

Slow down the spinner a bit#419
marc-vanderwal merged 1 commit intozonemaster:developfrom
marc-vanderwal:feature/slower-spinner

Conversation

@marc-vanderwal
Copy link
Contributor

Purpose

This PR slows down the spinner in zonemaster-cli to improve the animation’s appearance on the terminal and to avoid overloading the terminal’s standard output with thousands of calls.

In a nutshell, the code no longer advances the animation if the current frame has been showing for less than 0,1 seconds.

Context

Searching for performance improvements to be made in zonemaster-cli.

Changes

Slow down the spinner.

How to test this PR

Run zonemaster-cli zonemaster.net. The spinner’s animation should be slower, and actually look like it’s spinning. The animation may still pause briefly a few times, like before: that’s because Zonemaster-Engine sometimes does not emit any message for a few seconds while it is waiting for a response from remote name servers.

@marc-vanderwal marc-vanderwal added the V-Patch Versioning: The change gives an update of patch in version. label Jan 27, 2025
@marc-vanderwal marc-vanderwal added this to the v2025.1 milestone Jan 27, 2025
tgreenx
tgreenx previously approved these changes Jan 29, 2025
mattias-p
mattias-p previously approved these changes Feb 10, 2025
The console output of zonemaster-cli includes an optional spinner,
looping over four frames, with each frame being advanced whenever
Zonemaster::Engine outputs a message, even if it isn’t shown.

However, over the course of a single domain test, Zonemaster::Engine
outputs thousands of messages of level DEBUG1 or lower. As a result, the
spinner’s animation is far too fast to be enjoyable and a lot of strain
is put on the user’s terminal.

This change simply ensures that no frame is shown for less than 0.1
seconds. The animation looks smoother and doesn’t run the risk
overloading the terminal.
@marc-vanderwal marc-vanderwal dismissed stale reviews from mattias-p and tgreenx via 5a6c402 May 20, 2025 13:51
@marc-vanderwal marc-vanderwal force-pushed the feature/slower-spinner branch from a19cfdb to 5a6c402 Compare May 20, 2025 13:51
@marc-vanderwal
Copy link
Contributor Author

Rebased on latest develop in order to address conflicts. No functional change compared to the previous iteration.

@tgreenx and @mattias-p, can I have another review, please?

@marc-vanderwal marc-vanderwal merged commit e4fa522 into zonemaster:develop May 27, 2025
3 checks passed
@MichaelTimbert MichaelTimbert added the S-ReleaseTested Status: The PR has been successfully tested in release testing label Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-ReleaseTested Status: The PR has been successfully tested in release testing V-Patch Versioning: The change gives an update of patch in version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants