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

80 character loading string #102

Closed
kadrlica opened this issue Nov 2, 2016 · 0 comments
Closed

80 character loading string #102

kadrlica opened this issue Nov 2, 2016 · 0 comments

Comments

@kadrlica
Copy link
Collaborator

kadrlica commented Nov 2, 2016

I think that the default size of most terminals is 80 characters. The loading string is currently ~90 characters in length. This means that on most terminals it gets split to two lines effectively negating flushing the string to the same line. For example, here's how things look on my terminal set to 80 char width:

    |        ☆     |  Press Ctrl-C to abort    Rows : 10000, Avg time (rows/sec)
    |          ☆   |  Press Ctrl-C to abort    Rows : 20000, Avg time (rows/sec)
    |            ☆ |  Press Ctrl-C to abort    Rows : 30000, Avg time (rows/sec)
    |            ☆ |  Press Ctrl-C to abort    Rows : 40000, Avg time (rows/sec)
    |          ☆   |  Press Ctrl-C to abort    Rows : 50000, Avg time (rows/sec)
    |        ☆     |  Press Ctrl-C to abort    Rows : 60000, Avg time (rows/sec)

Expanding a bit, here is the full output:

    |           ☆  |  Press Ctrl-C to abort    Rows : 970000, Avg time (rows/sec): 18141.3
    |           ☆  |  Press Ctrl-C to abort    Rows : 1000000, Avg time (rows/sec): 17853.0

Notice that the rows are not of equal length (since the number of rows needed another digit). Dealing with the number of rows could be a bit complicated, but here is a suggested update to bring the loading string down to 80 characters.

    |           ☆  |  Press Ctrl-C to abort    Rows : 970000, Avg time (rows/sec): 18141.3
    |           ☆  |  Ctrl-C to abort;  Rows : 970000, Rows/sec: 18141

We could imagine formatting the number of rows and the rows/sec at fixed width. For example %-10d (unlikely to be more than 10 billion rows?) and the Rows/sec as %-6d (unlikely to be less than 1 row/sec or more that 1 million rows/sec?).

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

No branches or pull requests

1 participant