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

Improve efficiency of variable matching #736

Merged
merged 2 commits into from Feb 3, 2023
Merged

Conversation

sbfnk
Copy link
Contributor

@sbfnk sbfnk commented Feb 2, 2023

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

Improve the efficiency of variable matching to fix #735. This is done by first checking for exact matches and removing any matches from the following loop.

As far as I can tell this retains the exact same functionality. The example in #735 runs in under 10s vs. >2mins before. All relevant tests seem to pass.

Copyright and Licensing

Sebastian Funk

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2023

Codecov Report

Merging #736 (fba4bef) into master (b5d3a77) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #736      +/-   ##
==========================================
- Coverage   88.29%   88.28%   -0.02%     
==========================================
  Files          12       12              
  Lines        4075     4071       -4     
==========================================
- Hits         3598     3594       -4     
  Misses        477      477              
Impacted Files Coverage Δ
R/csv.R 96.42% <100.00%> (-0.02%) ⬇️
R/utils.R 74.01% <100.00%> (-0.12%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

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

Great stuff! Thanks a lot.

@rok-cesnovar rok-cesnovar merged commit ba2ce02 into stan-dev:master Feb 3, 2023
@jgabry
Copy link
Member

jgabry commented Feb 3, 2023

Awesome, thank you!

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.

Implementation of matching_variables and remaining_columns_to_read is inefficient and can cause hangs
4 participants