-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Consider using Jiff instead of Chrono #20471
Comments
Polars uses a Rust crate (chrono) for temporal features, as well as just plain integer arithmetic where possible. I don't think there's desire to take on extra required Python dependencies, but you could always just convert to integer and then parse with Is there any other usage of |
Thought I’d chime in since I was tagged. As suggested, @MarcoGorelli did you have a look at jiff yet? It’s a relatively new Rust datetime lib that takes inspiration from well-designed libraries in other languages. |
Not particularly. Just thought that for a product where speed is a key feature, associating with other projects aiming for the same has got to be beneficial. +1 for considering jiff as well. |
thanks both! there is some desire to have a faster version of Chrono in Rust, but it looks like Jiff may be slower than Chrono? https://github.com/BurntSushi/jiff/blob/master/COMPARE.md#chrono-is-faster-than-jiff-in-some-cases |
I can't speak for wanting faster datetime handling in polars. My preference for jiff is due to its IMHO superior datamodel, in line with what's proven to work in other languages. Chrono's datamodel is more idiosyncratic. You can see in their issue tracker that this gives problems. A modest improvement is in the works (version 0.5) but progress is very slow (understandable, but still) edit: grammar |
could you elaborate please? is there anywhere in polars where chrono's datamodel leads to issues, that could be addressed by jiff? |
My concerns overlap mostly with the ones mentioned by jiff, but these stand out to me:
😅 I’m not a polars user myself, so I can’t say whether this affects it. Being tagged by OP, I just wanted to add my 2 cents about datetime libraries. Feel free to make your own assessment about the right choice for polars—Chrono is definitely the more established library and a safe choice at the moment. |
thanks, interesting! ok for non-existent times this may be interesting, as the only strategies Polars currently supports for those are to raise or to coerce to None |
Jiff author here.
It really depends on what you're doing. Jiff's What operations in Aside from performance, the Jiff docs include a comparison with Chrono: https://docs.rs/jiff/latest/jiff/_documentation/comparison/index.html#chrono-v0438 Many of the benefits come from better time zone handling. I don't know how much of that polars does. |
Description
I'm not sure how feasible or desirable this is, so just opening this for hearing what you think -
@ariebovenberg's whenever
Here's how it benches -
Docs - https://whenever.readthedocs.io/en/stable/
The text was updated successfully, but these errors were encountered: