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

Fix/findshapes slow #270

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Fix/findshapes slow #270

merged 2 commits into from
Mar 5, 2021

Conversation

lawrence-mbf
Copy link
Collaborator

The current Datastub findShapes algorithm does not scale well at all and can potentially cause serious hangs. This PR greatly reduces the time taken to find the proper selection shapes.

Lawrence added 2 commits March 5, 2021 12:37
Original findShapes behavior involved three nested loops slowly iterating each
start/stop/step pointer which had the very real possibility of hanging on large
index sizes.

New method fixes this issue by trimming and subdividing disjoint block selections.
Originally just selected the first possible segment which isn't optimal. Now selects
the largest selection first.
@lawrence-mbf lawrence-mbf self-assigned this Mar 5, 2021
@codecov
Copy link

codecov bot commented Mar 5, 2021

Codecov Report

Merging #270 (b0b99ab) into master (1c4dadc) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #270      +/-   ##
==========================================
+ Coverage   47.46%   47.47%   +0.01%     
==========================================
  Files         124      124              
  Lines        5592     5594       +2     
==========================================
+ Hits         2654     2656       +2     
  Misses       2938     2938              
Impacted Files Coverage Δ
+types/+untyped/+datastub/findShapes.m 95.34% <100.00%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c4dadc...b0b99ab. Read the comment docs.

@lawrence-mbf lawrence-mbf merged commit df427d3 into master Mar 5, 2021
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.

1 participant