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

POSIX timestamp conversion is slow #504

Closed
jamessewell opened this issue Mar 25, 2022 · 2 comments · Fixed by #751
Closed

POSIX timestamp conversion is slow #504

jamessewell opened this issue Mar 25, 2022 · 2 comments · Fixed by #751

Comments

@jamessewell
Copy link
Contributor

I'm currently writing an agg which uses a Timestamp as part of it's state (I'm using State = Internal).

It looks like on each state function call the timestamp is pushed through pg_sys::timestamp2tm to convert to Rust (POSIX). This is pretty slow.

For a million records I'm seeing 149ms with it the call vs. 70ms without it enabled (tested by returning a static timestamp).

Not sure what could be done here - maybe using a custom implementation which mirrors the PG one's format?

@Hoverbear
Copy link
Contributor

I wonder if we could find a way to have the conversion to happen on demand... So it only happened if the user used it...

@jamessewell
Copy link
Contributor Author

jamessewell commented Mar 25, 2022 via email

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

Successfully merging a pull request may close this issue.

3 participants