Skip to content

REF: simplify sanitize_array #41592

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
merged 2 commits into from
May 21, 2021
Merged

Conversation

jbrockmendel
Copy link
Member

We end up calling _try_cast in 3 places instead of 5

@simonjayhawkins
Copy link
Member

does this give any perf improvement?

@simonjayhawkins simonjayhawkins added the Refactor Internal refactoring of code label May 21, 2021
@jreback jreback added this to the 1.3 milestone May 21, 2021
@jreback jreback merged commit 90882b8 into pandas-dev:master May 21, 2021
@jreback
Copy link
Contributor

jreback commented May 21, 2021

thanks, pls post perf if you can.

@jbrockmendel
Copy link
Member Author

will run asvs; will try to see if we have ones that go down all the affected paths

@jbrockmendel jbrockmendel deleted the ref-sanitize branch May 21, 2021 15:29
@jbrockmendel
Copy link
Member Author

with -b ctors

       before           after         ratio
     [99ec78ca]       [2085c19f]
     <master~2>       <ref-sanitize>
+        660±60μs         754±80μs     1.14  ctors.SeriesConstructors.time_series_constructor(<function list_of_str at 0x127049f70>, False, 'float')
+        644±60μs         691±90μs     1.07  ctors.SeriesConstructors.time_series_constructor(<function list_of_str at 0x127049f70>, False, 'int')
+        658±50μs         694±90μs     1.05  ctors.SeriesConstructors.time_series_constructor(<function list_of_str at 0x127049f70>, True, 'float')
+      3.18±0.3ms       3.21±0.2ms     1.01  ctors.SeriesConstructors.time_series_constructor(<function list_of_lists_with_none at 0x1270244c0>, True, 'int')
-     2.55±0.04ms       2.50±0.1ms     0.98  ctors.SeriesConstructors.time_series_constructor(<class 'list'>, False, 'int')
-        55.1±4μs         53.8±3μs     0.98  ctors.SeriesConstructors.time_series_constructor(<function no_change at 0x127049dc0>, False, 'int')
-      3.62±0.3ms       3.52±0.2ms     0.97  ctors.SeriesConstructors.time_series_constructor(<function arr_dict at 0x1270240d0>, True, 'int')
-      2.37±0.1ms       2.27±0.2ms     0.96  ctors.SeriesConstructors.time_series_constructor(<function arr_dict at 0x1270240d0>, False, 'float')
-        64.2±7μs         61.6±5μs     0.96  ctors.SeriesConstructors.time_series_constructor(<function no_change at 0x127049dc0>, True, 'float')
-      2.46±0.1ms       2.36±0.2ms     0.96  ctors.SeriesConstructors.time_series_constructor(<function arr_dict at 0x1270240d0>, True, 'float')
-      3.64±0.4ms       3.45±0.2ms     0.95  ctors.SeriesConstructors.time_series_constructor(<function arr_dict at 0x1270240d0>, False, 'int')
-      2.99±0.3ms       2.83±0.3ms     0.95  ctors.SeriesConstructors.time_series_constructor(<function list_of_lists at 0x1270243a0>, True, 'float')
-      4.55±0.2ms       4.28±0.2ms     0.94  ctors.SeriesConstructors.time_series_constructor(<function gen_of_str at 0x127024040>, False, 'float')
-      4.26±0.1ms       3.95±0.3ms     0.93  ctors.SeriesConstructors.time_series_constructor(<function gen_of_str at 0x127024040>, False, 'int')
-      3.16±0.1ms       2.85±0.3ms     0.90  ctors.SeriesConstructors.time_series_constructor(<function list_of_lists_with_none at 0x1270244c0>, False, 'int')
-      3.19±0.6ms       2.86±0.3ms     0.90  ctors.SeriesConstructors.time_series_constructor(<function list_of_lists_with_none at 0x1270244c0>, False, 'float')
-      3.00±0.3ms       2.69±0.2ms     0.90  ctors.SeriesConstructors.time_series_constructor(<function list_of_lists at 0x1270243a0>, True, 'int')
-      3.20±0.3ms       2.85±0.3ms     0.89  ctors.SeriesConstructors.time_series_constructor(<function list_of_tuples_with_none at 0x127024430>, False, 'int')
-      3.16±0.3ms       2.81±0.2ms     0.89  ctors.SeriesConstructors.time_series_constructor(<function list_of_lists_with_none at 0x1270244c0>, True, 'float')
-      4.49±0.2ms       3.98±0.2ms     0.89  ctors.SeriesConstructors.time_series_constructor(<function gen_of_tuples at 0x127024310>, False, 'float')
-      3.20±0.3ms       2.81±0.3ms     0.88  ctors.SeriesConstructors.time_series_constructor(<function list_of_tuples_with_none at 0x127024430>, False, 'float')
-      3.09±0.3ms       2.70±0.1ms     0.87  ctors.SeriesConstructors.time_series_constructor(<function list_of_lists at 0x1270243a0>, False, 'int')
-      3.09±0.2ms       2.70±0.2ms     0.87  ctors.SeriesConstructors.time_series_constructor(<function list_of_tuples at 0x127024280>, False, 'int')
-      3.13±0.2ms       2.72±0.1ms     0.87  ctors.SeriesConstructors.time_series_constructor(<function list_of_tuples at 0x127024280>, True, 'int')
-      3.15±0.3ms       2.69±0.1ms     0.86  ctors.SeriesConstructors.time_series_constructor(<function list_of_lists at 0x1270243a0>, False, 'float')
-      4.57±0.4ms       3.87±0.1ms     0.85  ctors.SeriesConstructors.time_series_constructor(<function gen_of_tuples at 0x127024310>, False, 'int')
-      3.23±0.3ms       2.69±0.1ms     0.83  ctors.SeriesConstructors.time_series_constructor(<function list_of_tuples at 0x127024280>, True, 'float')

TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants