-
-
Notifications
You must be signed in to change notification settings - Fork 18.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
Remove property that re-computed microsecond #17331
Conversation
just accessing the already-existing attribute is about 10x faster than re-computing it
@jbrockmendel : Could you post performance metrics in this PR just for reference? |
See update above. |
The error on Travis here is identical to the one in #17318. I can't reproduce it locally in either branch. Is it plausible that the issue is with Travis? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a whatsnew note and asv (and add asv for all Timestamp properties)
Hello @jbrockmendel! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on August 29, 2017 at 14:47 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #17331 +/- ##
==========================================
- Coverage 91.01% 90.99% -0.02%
==========================================
Files 162 162
Lines 49567 49567
==========================================
- Hits 45113 45104 -9
- Misses 4454 4463 +9
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #17331 +/- ##
==========================================
- Coverage 91.01% 90.99% -0.02%
==========================================
Files 162 163 +1
Lines 49567 49561 -6
==========================================
- Hits 45113 45098 -15
- Misses 4454 4463 +9
Continue to review full report at Codecov.
|
Just pushed with asv and note in whatsnew. Two runs of asv results:
|
Looks like the Travis error is the same OSX error that is happening elsewhere. The AppVeyor error message looked like an HTTP timeout. |
doc/source/whatsnew/v0.21.0.txt
Outdated
@@ -325,7 +325,7 @@ Performance Improvements | |||
|
|||
- Improved performance of instantiating :class:`SparseDataFrame` (:issue:`16773`) | |||
- :attr:`Series.dt` no longer performs frequency inference, yielding a large speedup when accessing the attribute (:issue:`17210`) | |||
|
|||
- `Timestamp.microsecond` no longer re-computes on attribute access. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the PR number as the issue. we always want a reference to an entry in whatsnew (issue preferd, or PR if not avail).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either use double-backticks, or :attr:`Timestamp.microsecond`
(in general prefer the api references). I don't think this API reference will actually work ATM as Timestamp
is not defined in api.rst (so separate issue to rectify that).
What's the syntax for referencing a PR? For an Issue I'd use |
same syntax just use the pr number |
thanks! |
Just accessing the already-existing attribute is about 50-130x faster than re-computing it. These results are from a 2011-era MBP.
Before:
After:
This accounts for the discrepancy discussed in #17234 (#17297 (review))
Per requests from @jreback, I'm refraining from moving forward with any other optimizations that this makes possible (e.g. removing the roundabout call to
convert_to_tsobject
fromTimestamp.to_pydatetime
).git diff upstream/master -u -- "*.py" | flake8 --diff