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

Adjust ljust #16

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Adjust ljust #16

merged 1 commit into from
Nov 8, 2024

Conversation

kaiquekandykoga
Copy link
Contributor

@kaiquekandykoga kaiquekandykoga commented Aug 8, 2022

Benchmark#bm with labels was not using the highest length
among the labels to adjust the correct ljust. Instead of
printing the result during the report generation,
now it is waiting to print the result once it is generated.

Benchmark.bm { |x|
  x.item("aaaa") { 1 }
  x.item("aaaaaaaa") { 0 }
}

After

              user     system      total        real
aaaa      0.000005   0.000002   0.000007 (  0.000003)
aaaaaaaa  0.000001   0.000001   0.000002 (  0.000002)

Before

       user     system      total        real
aaaa  0.000005   0.000001   0.000006 (  0.000003)
aaaaaaaa  0.000002   0.000001   0.000003 (  0.000003)

Benchmark#bm with labels was not using the highest length
among the labels to adjust the correct ljust. Instead of
printing the result during the report generation,
now it is waiting to print the result once it is generated.

Benchmark.bm { |x|
  x.item("aaaa") { 1 }
  x.item("aaaaaaaa") { 0 }
}

After

              user     system      total        real
aaaa      0.000005   0.000002   0.000007 (  0.000003)
aaaaaaaa  0.000001   0.000001   0.000002 (  0.000002)

Before

       user     system      total        real
aaaa  0.000005   0.000001   0.000006 (  0.000003)
aaaaaaaa  0.000002   0.000001   0.000003 (  0.000003)
@hsbt hsbt merged commit b768760 into ruby:master Nov 8, 2024
@hsbt
Copy link
Member

hsbt commented Nov 8, 2024

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants