Skip to content

Granularity: Introduce primitive-typed bucketStart, increment methods.#10904

Merged
gianm merged 3 commits intoapache:masterfrom
gianm:floor-expr-speedier
Feb 25, 2021
Merged

Granularity: Introduce primitive-typed bucketStart, increment methods.#10904
gianm merged 3 commits intoapache:masterfrom
gianm:floor-expr-speedier

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Feb 19, 2021

Saves creation of unnecessary DateTime objects in timestamp_floor and
timestamp_ceil expressions.

I was running a query that had a group by floor(__time to year) in it and was greeted by the following flame graph:

image

33% of the time is spent on DateTime.<init>. It's not necessary, because the PeriodGranularity code is doing the hard work on the primitive milliseconds.

Saves creation of unnecessary DateTime objects in timestamp_floor and
timestamp_ceil expressions.
Copy link
Copy Markdown
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

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

nice 🤘

@gianm
Copy link
Copy Markdown
Contributor Author

gianm commented Feb 25, 2021

It looks like the CI failure was in the coverage checker. I pushed a new patch that improves test coverage.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants