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

Convert time.Time to int64 #5841

Merged
merged 1 commit into from
Feb 25, 2016
Merged

Convert time.Time to int64 #5841

merged 1 commit into from
Feb 25, 2016

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Feb 25, 2016

This change converts all the uses of time.Time to int64 within the TSM engine. This was an idea initially presented in #5522, but didn't make sense to implement until query engine and other changes had completed.

Since we mainly using timestamps as UnixNano values anyways, the overhead of using a time.Time everywhere ends up creating a lot of garbage for GC to work though. This change should help with GC and larger queries that process a lot of points.

A simple count query over 100M points improved from 53s to 38s with this change.

$ time influx -database stress -execute "select count(value) from cpu"
name: cpu
---------
time    count
0   1e+08


real    0m52.670s
user    0m0.006s
sys 0m0.006s

After:

$ time influx -database stress -execute "select count(value) from cpu"
name: cpu
---------
time    count
0   1e+08


real    0m38.107s
user    0m0.005s
sys 0m0.006s
  • CHANGELOG.md updated
  • Rebased/mergable
  • Tests pass
  • Sign CLA (if not already signed)

@jwilder
Copy link
Contributor Author

jwilder commented Feb 25, 2016

@benbjohnson

@benbjohnson
Copy link
Contributor

lgtm. 👏 That's a nice 14s drop in query time!

jwilder added a commit that referenced this pull request Feb 25, 2016
@jwilder jwilder merged commit 941fe4c into master Feb 25, 2016
@jwilder jwilder deleted the jw-time-int64 branch February 25, 2016 22:32
@julienmathevet
Copy link

👍 nice refactoring

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