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

Improve performance #16

Merged
merged 11 commits into from
Dec 8, 2024
Merged

Improve performance #16

merged 11 commits into from
Dec 8, 2024

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented Dec 6, 2024

Summary

I noticed that many operations were performed more than once unnecessarily.

This PR aims to reduce this duplication.

It is not a perfect solution but it is the one that respects more the current structure.

I notice a speedup 690 ms -> 580 ms

Related GitHub Issues and PRs

@rich-iannone
Copy link
Member

Thank you! As with the other projects, please add yourself to the DESCRIPTION as your contributions are valuable!

@olivroy
Copy link
Collaborator Author

olivroy commented Dec 6, 2024

Thanks! I will stop it there for now. But I see about +30-50% performance improvement for the base fmt_datetime() from gt. Less operations are performed unnecessarily which greatly improves speed! As mentioned in a few places, it would be great to vectorize somehow, but the date-time formatting is quite comprehensive and we may simply want to branch out to simpler functions for the most trivial cases and keep {bigD} structure otherwise mostly untouched, except for the changes I propose here.

@olivroy olivroy requested a review from rich-iannone December 6, 2024 21:25
@olivroy olivroy marked this pull request as draft December 6, 2024 21:44
@olivroy
Copy link
Collaborator Author

olivroy commented Dec 6, 2024

Oops, just ran gt tests and discovered a slight regression. Will add test + fix soon

All good now!

Also, if possible a codecov token would be great to be able to track coverage if needed :)

Currently on main

image

This PR: (apparently reduced coverage even though I added a test that covers new stuff)
image

@olivroy olivroy marked this pull request as ready for review December 6, 2024 22:25
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

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

LGTM!

@rich-iannone rich-iannone merged commit f2e43e3 into rstudio:main Dec 8, 2024
8 checks passed
@olivroy olivroy deleted the perf2 branch December 9, 2024 13:54
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.

2 participants