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 ASTPkg.Analyze #3945

Closed
williamhbaker opened this issue Aug 9, 2021 · 1 comment
Closed

Optimize ASTPkg.Analyze #3945

williamhbaker opened this issue Aug 9, 2021 · 1 comment

Comments

@williamhbaker
Copy link
Contributor

williamhbaker commented Aug 9, 2021

In ASTPkg.Analyze, calling C.flux_analyze(...) takes on the order of 5-8ms for every query on my machine (2019 MacBook Pro, 2.6 GHz 6-core i7) running on Influxdb OSS v2.0.7.

This isn't a very big deal for long-running queries in the 100's or 1000's of ms (or longer), but for fast-running queries it can be a large contributor to the total response time of the query.

For example, a flux query like the following executed on a fairly small set of data (generated from the influxdb-comparisons tool using the devops use case) takes about 10ms to run for me locally, with about 6ms coming from the C.flux_analyze(...) call:

from(bucket: "benchmark_db") 
  |> range(start: -5m) 
  |> filter(fn:(r) => r._measurement == "cpu" and r._field == "usage_user") 

An equivalent InfluxQL query like the following will complete in ~1ms, so the flux query is about 10x slower, with a large amount of that extra time coming from the aforementioned method:

SELECT usage_user from cpu where time >= '<now-5 minutes>' and time < '<now>'
@github-actions
Copy link

This issue has had no recent activity and will be closed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant