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 ReducePercentile method #5510

Merged
merged 1 commit into from
Feb 11, 2016

Conversation

bsideup
Copy link
Contributor

@bsideup bsideup commented Feb 2, 2016

  1. do not call len(allValues) twice
  2. move sorting after index check
  • CHANGELOG.md updated
  • Rebased/mergable
  • Tests pass
  • Sign CLA (if not already signed)

@jwilder
Copy link
Contributor

jwilder commented Feb 10, 2016

This code has changed quite a bit since #5196 landed. I believe this code is now located here: https://github.com/influxdata/influxdb/blob/master/influxql/call_iterator.go#L760-L798 This PR needs to be updated if it's still an issue.

@benbjohnson @jsternberg

@jwilder jwilder added this to the 0.11.0 milestone Feb 10, 2016
@bsideup
Copy link
Contributor Author

bsideup commented Feb 10, 2016

@jwilder it's still there, I will update

@bsideup bsideup force-pushed the reduce_percentile_optimizations branch from 30975ef to eef0e41 Compare February 11, 2016 18:05
@bsideup
Copy link
Contributor Author

bsideup commented Feb 11, 2016

@jwilder done. Please take a look :)

A little bit of explanation:

  1. We shouldn't sort array until we decide to use it as a sorted (i.e. corner cases when i < 0 || i > len(a) )
  2. We can reuse len(arr) call. Not that critical, but still saves some CPU cycles :)

@jsternberg
Copy link
Contributor

👍

1 similar comment
@jwilder
Copy link
Contributor

jwilder commented Feb 11, 2016

👍

jwilder added a commit that referenced this pull request Feb 11, 2016
@jwilder jwilder merged commit db9a14b into influxdata:master Feb 11, 2016
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.

3 participants