Skip to content

Conversation

MichaelChirico
Copy link
Collaborator

@MichaelChirico MichaelChirico commented Jun 8, 2022

Closes #778

I'm having some hardware (software?) issue where the drive with my CRAN mirror keeps disconnecting itself, which makes a long-running comparison pretty tough. Hopefully figure that out soon (and anyway it's more motivation to support just ad hoc downloading packages from a mirror), but anyway we can merge this now.

@MichaelChirico
Copy link
Collaborator Author

OK, I think extensions necessary to run --branch=v2.0.1 are done. Also not passing --linters --> use all linters facilitates "run everything that was available".

Now to get some timings...

@MichaelChirico MichaelChirico changed the title WIP: benchmarking in .dev/compare_branches benchmarking in .dev/compare_branches Jun 9, 2022
@MichaelChirico MichaelChirico requested a review from AshesITR June 9, 2022 18:41
@MichaelChirico
Copy link
Collaborator Author

MichaelChirico commented Jun 9, 2022

OK @AshesITR this is ready for review... pending TODO can be handled in follow-up, it's mostly cosmetic. This now works:

.dev/compare_branches.R --branch=v2.0.1 --sample_size=20 --benchmark=true

(not sure why optparse doesn't allow --benchmark to work since we declare the parameter as logical 🤔)

Copy link
Collaborator

@AshesITR AshesITR left a comment

Choose a reason for hiding this comment

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

LGTM

)
)
# delete noisy/redundant information from filename
timings_data[, filename := sub(file.path(tempdir(), .BY$package, ""), "", filename), by = package]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice gem. I didn't know about .BY 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

needed because sub doesn't vectorize on pattern

@MichaelChirico MichaelChirico merged commit a3c167b into main Jun 12, 2022
@MichaelChirico MichaelChirico deleted the compare-benchmark branch June 12, 2022 16:21
AshesITR added a commit that referenced this pull request Jun 12, 2022
* skeleton for new --benchmark parameter

* incredibly hacky (but working on main at least) tracing approach

* Rename old master branch to main in .dev/compare_branches

* tweaks

* run .Last() even interactively

* debugging complete! works on main

* handle --branch=$TAG

* help mentions tag; git_branch_checkout doesnt work

* need to git reset

* robustly get linter call

* cant rely on ~recent internal helper for encoding

* remove remotes from temp repo

* handle odd case of line_length_linter, muffle newline warnings

* warn with tag names, not hashes

* implement _all_ option for linters, skip more noisy warnings

* fix default handling; simplify encoding test; correct branch-specific timings

* combine timings, save output

* save in wide format instead

* comment

* correct message

* add a TODO

* sum timing across expressions in output

* correct data.table imports

* refactor: use more helpers

* consolidate more

* another helper

* more refactoring... pray this works

* tweaks go get working

* correct handling of timing output

* add a TODO

* clarify TODO

* correct data.table imports again

* more nesting!

* one more helper

* remove debugger

* simplify warning message match

Co-authored-by: AshesITR <[email protected]>
jimhester added a commit that referenced this pull request Jun 13, 2022
* change deprecated versions from 2.0.1.9001 to 3.0.0

fixes #835

* typo in NEWS (#1367)

* Rename old master branch to main in .dev/compare_branches (#1372)

* Deprecate find col (#1374)

* first pass -- scorched earth

* deprecate instead

* whitespace

* NEWS

Co-authored-by: AshesITR <[email protected]>

* Another round of NEWS polishing (#1370)

* add reasoning to "return" removal

* mention old argument still works

* combine+clarify some brace_linter items, add attributions

* consistent capitalization, clarifications

* finish pass for consistent capitalizatoin

* grammar

* move object_name bullet with others; clarify cyclocomp bullet

* mention CRAN policy re: cache directory

* more consistently reference only the issue (not PR) #s

* consistent capitalization in my GH username

* missing item for any_duplicated_linter

* improve description of system_file_linter

* clarify strings_as_factors_linter, more grammar

* more quantification of package speed-ups; more clarirfication

* more removing redundant issue references; reorg bullet for get_source_expressions

* clarification, remove redundant issue refs

* move another object_name_linter bullet up

* move extraction_operator item to "features" not bugs

* trailing whitespace

* trailing whitespace

* feedback

* lead with Deprecated

* wording for object_usage

* de-lint (#1378)

* de-lint

* tidyverse style, missing space

Co-authored-by: Michael Chirico <[email protected]>

* add tag "executing" to linters that call eval() or loadNamespace() on arbitrary input (#1383)

* benchmarking in .dev/compare_branches (#1375)

* skeleton for new --benchmark parameter

* incredibly hacky (but working on main at least) tracing approach

* Rename old master branch to main in .dev/compare_branches

* tweaks

* run .Last() even interactively

* debugging complete! works on main

* handle --branch=$TAG

* help mentions tag; git_branch_checkout doesnt work

* need to git reset

* robustly get linter call

* cant rely on ~recent internal helper for encoding

* remove remotes from temp repo

* handle odd case of line_length_linter, muffle newline warnings

* warn with tag names, not hashes

* implement _all_ option for linters, skip more noisy warnings

* fix default handling; simplify encoding test; correct branch-specific timings

* combine timings, save output

* save in wide format instead

* comment

* correct message

* add a TODO

* sum timing across expressions in output

* correct data.table imports

* refactor: use more helpers

* consolidate more

* another helper

* more refactoring... pray this works

* tweaks go get working

* correct handling of timing output

* add a TODO

* clarify TODO

* correct data.table imports again

* more nesting!

* one more helper

* remove debugger

* simplify warning message match

Co-authored-by: AshesITR <[email protected]>

* Polish news (#1384)

* consistent formatting

* sort bullets alphabetically

* add `allow_trailing = FALSE` to `missing_argument_linter()` (#1385)

* update deprecations

* usethis::use_version("major")

* update reference checkstyle.xml

Co-authored-by: Michael Chirico <[email protected]>
Co-authored-by: Michael Chirico <[email protected]>
Co-authored-by: Jim Hester <[email protected]>
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.

Add proper benchmarking functionality to .dev/compare_branches.R

2 participants