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

Consistent time units (by default) #80

Closed
engineerchange opened this issue May 10, 2020 · 2 comments
Closed

Consistent time units (by default) #80

engineerchange opened this issue May 10, 2020 · 2 comments

Comments

@engineerchange
Copy link

engineerchange commented May 10, 2020

Bench currently mixes time units when displaying performance statistics; request a feature to make the reporting consistent by the data across all rows/columns, by default.

Stealing from @dcooley's mention here. He also references this github comment.

library(bench)


foo <- function() Sys.sleep(5)
bar <- function() Sys.sleep(0.1)

bench::mark(foo(), bar())

# # A tibble: 2 x 13
# expression          min   median `itr/sec` mem_alloc `gc/sec` n_itr  n_gc total_time result memory           time     gc              
# <bch:expr>     <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl> <int> <dbl>   <bch:tm> <list> <list>           <list>   <list>          
#   1 foo()            5s       5s     0.200        0B        0     1     0         5s <NULL> <df[,3] [0 × 3]> <bch:tm> <tibble [1 × 3]>
#   2 bar()         100ms    100ms     9.92         0B        0     5     0      504ms <NULL> <df[,3] [0 × 3]> <bch:tm> <tibble [5 × 3]>
@jimhester
Copy link
Member

This is what the time_unit argument is for. If you want consistent units in the display specify what unit you want them displayed in.

@dcooley
Copy link

dcooley commented May 12, 2020

I think @engineerchange was asking if it's possible to make the consistent units the default, rather than mixing them by default.

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

3 participants