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

Optimize Blueflood resolution selection loop into division #294

Merged
merged 2 commits into from
Jun 14, 2016

Conversation

Nathan-Fenner
Copy link
Contributor

@Nathan-Fenner Nathan-Fenner commented Jun 9, 2016

There are two optimizations here:

  • A for-loop has been replaced with a division in the interval-planning stage
  • Interval-planning is performed only once total when fetching multiple series, and not once per timeseries

@drcapulet

@Nathan-Fenner Nathan-Fenner force-pushed the nathan-fenner-blueflood-division branch from 25b4fbb to 167cf95 Compare June 9, 2016 22:57
// At least one point is included, so:
answer[resolution] = api.Interval{Start: originalHere, End: here}
answer[resolution] = api.Interval{Start: here, End: newHere}
here = newHere
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where the loop is optimized. The resulting code behaves identically.

@drcapulet
Copy link
Collaborator

🚢

@drcapulet drcapulet merged commit 3bfc0fc into master Jun 14, 2016
@drcapulet drcapulet deleted the nathan-fenner-blueflood-division branch June 14, 2016 19:22
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.

None yet

2 participants