-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
PERF: cythonizing _concat_date_cols; conversion to float without exceptions in _does_string_look_like_datetime #25754
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
Merged
jreback
merged 42 commits into
pandas-dev:master
from
anmyachev:datehelpers-performance-patch
May 12, 2019
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
45dfa46
PERF: rewrited _concat_date_cols function on C with removing extra co…
anmyachev 1531ec9
perf bench for _concat_date_cols
anmyachev 0756da9
Add benchmark for _does_string_look_like_datetime
vnlitvinov 36b8bdb
implemented _does_string_look_like_datetime in cython
anmyachev a9afbdb
new benchmark for _concat_date_cols func
anmyachev ee1f32b
init cython version of _concat_date_cols
anmyachev 84e1b00
fix C version of _concat_date_cols
anmyachev 2cf9f22
added ConcatDateColsList benchmark
anmyachev 28fd5f5
ready cython version, combined concat benchmarks
anmyachev 1f17cf9
added forgotten check for float NaN
anmyachev d1f8ce5
Cython version of _concat_date_cols works for all cases
vnlitvinov e44212c
Fix typo in _concat_date_cols
vnlitvinov 6af73bf
used flatiter for numpy array
anmyachev d4305a9
Fix Cython compilation issues
vnlitvinov fa3ae05
Remove C version of _concat_date_cols
vnlitvinov 49d66e0
Fix linting errors
vnlitvinov 09e4da6
Try to speed up 1D list
vnlitvinov 67d9509
Hopefully speed up 2D case
vnlitvinov f05564d
Fix isort, retain some comments
vnlitvinov b9c96fd
removed unnecessary common_include list with headers; some change cod…
anmyachev 6dc3c51
using util.is_array now; changed double to float64_t; fix docstring
anmyachev 08c7f47
split _concat_date_cols functionality
anmyachev ba6b86a
added error parameter for xstrtod call
anmyachev 14b9cad
removed Py_SIZE; renamed indexes
anmyachev 4e9211b
Switch to helper method for getting C buffer of string object
vnlitvinov 0aefa7b
changed return type in _concat_date_cols_* functions from void to cnp…
anmyachev a3a0a77
added doc-string to _concat_date_cols* functions
anmyachev f1ae23c
added doc-string for convert_and_set_item func; removed isinstance(it…
anmyachev 8797e53
fix docstrings
anmyachev 3bdb452
currently only one conversion function is used - convert_to_unicode
anmyachev dcbcd9a
added some comments in _concat_date_cols_numpy
anmyachev 1d9c7b7
fix problem from rebase
anmyachev b4fc887
added some comments in _does_string_look_like_datetime
anmyachev 25ee2d2
changed default value of keep_trivial_numbers to true
anmyachev 2046dcb
Remove not needed try..except in _does_string_look_like_datetime benc…
vnlitvinov 28b6670
upgraded doc-ststring; added some blank lines
anmyachev 30f70ab
removed '_concat_date_cols_sequence' func
anmyachev 3800c40
now only one function '_concat_date_cols'
anmyachev b45df3f
removed 'do_convert' local var from 'convert_to_unicode'
anmyachev 43dffec
replaced '_concat_date_cols' and 'convert_to_unicode' from lib.pyx to…
anmyachev c06a662
added 'test_concat_date_col_fail' test
anmyachev 5dda33c
added doc-string to '_does_string_look_like_datetime' func; changed '…
anmyachev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import numpy as np | ||
|
||
from pandas._libs.tslibs.parsing import ( | ||
_concat_date_cols, _does_string_look_like_datetime) | ||
|
||
|
||
class DoesStringLookLikeDatetime(object): | ||
|
||
params = (['2Q2005', '0.0', '10000'],) | ||
param_names = ['value'] | ||
|
||
def setup(self, value): | ||
self.objects = [value] * 1000000 | ||
|
||
def time_check_datetimes(self, value): | ||
for obj in self.objects: | ||
_does_string_look_like_datetime(obj) | ||
|
||
|
||
class ConcatDateCols(object): | ||
|
||
params = ([1234567890, 'AAAA'], [1, 2]) | ||
param_names = ['value', 'dim'] | ||
|
||
def setup(self, value, dim): | ||
count_elem = 10000 | ||
if dim == 1: | ||
self.object = (np.array([value] * count_elem),) | ||
if dim == 2: | ||
self.object = (np.array([value] * count_elem), | ||
np.array([value] * count_elem)) | ||
|
||
def time_check_concat(self, value, dim): | ||
_concat_date_cols(self.object) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.