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

optimise gregorian #160

Merged
merged 2 commits into from
Oct 16, 2022
Merged

optimise gregorian #160

merged 2 commits into from
Oct 16, 2022

Conversation

conradludgate
Copy link
Contributor

The loops that were originally there didn't optimise well. This new code optimises much better with less branches

Screenshot 2022-10-16 at 11 01 36

The one regression is a false positive and on re-runs switched between + and -

@codecov-commenter
Copy link

Codecov Report

Base: 78.75% // Head: 78.88% // Increases project coverage by +0.12% 🎉

Coverage data is based on head (4c7a0f4) compared to base (896243f).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #160      +/-   ##
==========================================
+ Coverage   78.75%   78.88%   +0.12%     
==========================================
  Files           9        9              
  Lines        2349     2363      +14     
==========================================
+ Hits         1850     1864      +14     
  Misses        499      499              
Impacted Files Coverage Δ
src/epoch.rs 88.07% <100.00%> (+0.14%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ChristopherRabotin
Copy link
Member

Wow, this is a fantastic improvement in speed! Thanks!

I'll merge this is right away. Do you need this to be on crates.io right now or can it wait a bit?

@ChristopherRabotin ChristopherRabotin merged commit 79fa195 into nyx-space:master Oct 16, 2022
@conradludgate
Copy link
Contributor Author

I'm in no rush, I saw this on reddit and thought I'd help out. I'm on a mission to make all time libraries efficient :)

@ChristopherRabotin
Copy link
Member

If there are any features you need that would make you consider using hifitime instead of another library at TrueLayer, let me know. My use case is quite narrowly focused on engineering and scientific applications, so I may miss the broader requirements that folks need, but I would really like it if hifitime became as useful to the Rust community as time.rs or chrono.

@conradludgate
Copy link
Contributor Author

I will definitely let you know. The kind of features we make use of are RFC3339 formatting, and recently working with dates only - eg adding months or finding the monday of week 12. I understand this use case is quite different to what hifitime is currently intending

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