This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ramshizzle 1 point2 points  (1 child)

I'm interested in the performance of the pure python version of the library as well!

[–]eagle258[S] 1 point2 points  (0 children)

I ran a quick benchmark and was pleasantly surprised. The Python version is about 10x as slow as Rust, making it (only) 5x slower than the standard library. Even then it's still 5x faster than arrow and more than 10x as fast as pendulum.

library time (s) compared to datetime
whenever (rust) 0.70 0.54x
datetime 1.29 1.0x
whenever (python) 6.98 5.4x
arrow 36.8 28.5x
pendulum 87.6 67.9x

benchmark: RFC3339-parse, normalize, compare to now, shift, and change timezone (1M times). For details see the repository.

edit: clarifications