-
Notifications
You must be signed in to change notification settings - Fork 187
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
Use | more judiciously #2028
Use | more judiciously #2028
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2028 +/- ##
=======================================
Coverage 98.55% 98.55%
=======================================
Files 113 113
Lines 4994 4995 +1
=======================================
+ Hits 4922 4923 +1
Misses 72 72
|
Very little (if any) improvement on exp <- get_source_expressions("QC.R")
l <- redundant_equals_linter()
# AT HEAD
system.time(replicate(500, lapply(exp$expressions, l)))
# user system elapsed
# 35.225 0.172 35.577
# AT ae0551b
system.time(replicate(500, lapply(exp$expressions, l)))
# user system elapsed
# 35.147 0.120 35.392 Checking on |
Oh interesting, # HEAD
system.time(replicate(500, lapply(exp$expressions, l)))
# user system elapsed
# 171.315 0.280 172.313
# d4e93e1
system.time(replicate(500, lapply(exp$expressions, l)))
# user system elapsed
# 83.125 0.118 83.554 |
Lint will go away after merging #2033 |
Re-examined in what situations
|
can be used.Till now we've often conservatively used
//NODE1[ $BIG_EXPRESSION ] | //NODE2[ $BIG_EXPRESSION ]
, but this works fine:(//NODE1 | //NODE2)[ $BIG_EXPRESSION ]
.Untested as yet but I am assuming this can have some efficiency benefit (or at least not hurt, while hopefully making the code more readable).
Marking as draft for now since
infix_spaces_linter()
will likely benefit and #2025 is pending, but feel free to review the existing changes. I'll also try and add some timings.