Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorisvandenbossche/0af1c0a20ef187197ecdcfdb3545306a to your computer and use it in GitHub Desktop.
Save jorisvandenbossche/0af1c0a20ef187197ecdcfdb3545306a to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Overview pandas ASV benchmarks"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import itertools\n",
"import json\n",
"\n",
"import pandas as pd\n",
"\n",
"pd.options.display.max_colwidth = 200\n",
"pd.options.display.max_rows = 100"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Run of the benchmarks at 2021-11-15 (latest HEAD) with `asv run --quick --show-stderr --python=same --set-commit-hash HEAD` (so without repetitions):"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"with open(\"HEAD-existing-py_home_joris_miniconda3_envs_dev39_bin_python.json\") as f:\n",
" benchmark_results = json.load(f)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Extract "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"data = benchmark_results[\"results\"]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"def get_total_time(bench):\n",
" timings = []\n",
" total_timings = []\n",
" for stats in bench[\"stats\"]:\n",
" if stats is None:\n",
" timings.append(0)\n",
" total_timings.append(0)\n",
" else:\n",
" timings.append(stats[\"mean\"])\n",
" total = stats[\"mean\"] * stats[\"number\"] * stats[\"repeat\"]\n",
" total_timings.append(total)\n",
" if \"params\" in bench:\n",
" params = [\"-\".join(p) for p in itertools.product(*bench[\"params\"])]\n",
" else:\n",
" assert len(timings) == 1\n",
" params = [\"\"]\n",
" return params, timings, total_timings"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"names = []\n",
"params = []\n",
"timings = []\n",
"total_timings = []\n",
"\n",
"for name in data.keys():\n",
" bench = data[name]\n",
" if isinstance(bench, dict) and \"stats\" in bench:\n",
" params_, timings_, total_timings_ = get_total_time(bench)\n",
" names.extend([name] * len(params_))\n",
" params.extend(params_)\n",
" timings.extend(timings_)\n",
" total_timings.extend(total_timings_)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"df = pd.DataFrame({\"name\": names, \"params\": params, \"time\": timings, \"total_time\": total_timings})"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" <th>params</th>\n",
" <th>time</th>\n",
" <th>total_time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>algorithms.Duplicated.time_duplicated</td>\n",
" <td>True-'first'-'int'</td>\n",
" <td>0.000029</td>\n",
" <td>0.000029</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>algorithms.Duplicated.time_duplicated</td>\n",
" <td>True-'first'-'uint'</td>\n",
" <td>0.000023</td>\n",
" <td>0.000023</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>algorithms.Duplicated.time_duplicated</td>\n",
" <td>True-'first'-'float'</td>\n",
" <td>0.000023</td>\n",
" <td>0.000023</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>algorithms.Duplicated.time_duplicated</td>\n",
" <td>True-'first'-'string'</td>\n",
" <td>0.000034</td>\n",
" <td>0.000034</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>algorithms.Duplicated.time_duplicated</td>\n",
" <td>True-'first'-'datetime64[ns]'</td>\n",
" <td>0.000031</td>\n",
" <td>0.000031</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9360</th>\n",
" <td>timedelta.DatetimeAccessor.time_timedelta_seconds</td>\n",
" <td></td>\n",
" <td>0.004912</td>\n",
" <td>0.004912</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9361</th>\n",
" <td>tslibs.timedelta.TimedeltaProperties.time_timedelta_days</td>\n",
" <td></td>\n",
" <td>0.000011</td>\n",
" <td>0.000011</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9362</th>\n",
" <td>tslibs.timedelta.TimedeltaProperties.time_timedelta_microseconds</td>\n",
" <td></td>\n",
" <td>0.000011</td>\n",
" <td>0.000011</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9363</th>\n",
" <td>tslibs.timedelta.TimedeltaProperties.time_timedelta_nanoseconds</td>\n",
" <td></td>\n",
" <td>0.000031</td>\n",
" <td>0.000031</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9364</th>\n",
" <td>tslibs.timedelta.TimedeltaProperties.time_timedelta_seconds</td>\n",
" <td></td>\n",
" <td>0.000028</td>\n",
" <td>0.000028</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>9365 rows × 4 columns</p>\n",
"</div>"
],
"text/plain": [
" name \\\n",
"0 algorithms.Duplicated.time_duplicated \n",
"1 algorithms.Duplicated.time_duplicated \n",
"2 algorithms.Duplicated.time_duplicated \n",
"3 algorithms.Duplicated.time_duplicated \n",
"4 algorithms.Duplicated.time_duplicated \n",
"... ... \n",
"9360 timedelta.DatetimeAccessor.time_timedelta_seconds \n",
"9361 tslibs.timedelta.TimedeltaProperties.time_timedelta_days \n",
"9362 tslibs.timedelta.TimedeltaProperties.time_timedelta_microseconds \n",
"9363 tslibs.timedelta.TimedeltaProperties.time_timedelta_nanoseconds \n",
"9364 tslibs.timedelta.TimedeltaProperties.time_timedelta_seconds \n",
"\n",
" params time total_time \n",
"0 True-'first'-'int' 0.000029 0.000029 \n",
"1 True-'first'-'uint' 0.000023 0.000023 \n",
"2 True-'first'-'float' 0.000023 0.000023 \n",
"3 True-'first'-'string' 0.000034 0.000034 \n",
"4 True-'first'-'datetime64[ns]' 0.000031 0.000031 \n",
"... ... ... ... \n",
"9360 0.004912 0.004912 \n",
"9361 0.000011 0.000011 \n",
"9362 0.000011 0.000011 \n",
"9363 0.000031 0.000031 \n",
"9364 0.000028 0.000028 \n",
"\n",
"[9365 rows x 4 columns]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Benchmarks that take the most time to run"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Slowest benchmark functions:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" <th>params</th>\n",
" <th>time</th>\n",
" <th>total_time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>3222</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'float'-'describe'-'direct'-10</td>\n",
" <td>24.076902</td>\n",
" <td>24.076902</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4038</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'uint'-'describe'-'direct'-10</td>\n",
" <td>16.194978</td>\n",
" <td>16.194978</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2950</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'int'-'describe'-'direct'-10</td>\n",
" <td>15.590451</td>\n",
" <td>15.590451</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3221</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'float'-'describe'-'direct'-5</td>\n",
" <td>13.073884</td>\n",
" <td>13.073884</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4303</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'string[python]'-'max'</td>\n",
" <td>12.792118</td>\n",
" <td>12.792118</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4302</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'string[python]'-'min'</td>\n",
" <td>11.113345</td>\n",
" <td>11.113345</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4293</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'mean'</td>\n",
" <td>9.893737</td>\n",
" <td>9.893737</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2949</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'int'-'describe'-'direct'-5</td>\n",
" <td>8.977205</td>\n",
" <td>8.977205</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4300</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'string[python]'-'sum'</td>\n",
" <td>7.758854</td>\n",
" <td>7.758854</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4294</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'median'</td>\n",
" <td>7.410970</td>\n",
" <td>7.410970</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4298</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'any'</td>\n",
" <td>7.178809</td>\n",
" <td>7.178809</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4037</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'uint'-'describe'-'direct'-5</td>\n",
" <td>7.140640</td>\n",
" <td>7.140640</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4299</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'all'</td>\n",
" <td>6.905889</td>\n",
" <td>6.905889</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4289</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'sum'</td>\n",
" <td>6.729190</td>\n",
" <td>6.729190</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7489</th>\n",
" <td>timeseries.DatetimeIndex.time_normalize</td>\n",
" <td>'tz_local'</td>\n",
" <td>6.453705</td>\n",
" <td>6.453705</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5522</th>\n",
" <td>package.TimeImport.time_import</td>\n",
" <td></td>\n",
" <td>6.367532</td>\n",
" <td>6.367532</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3220</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'float'-'describe'-'direct'-2</td>\n",
" <td>6.159515</td>\n",
" <td>6.159515</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7499</th>\n",
" <td>timeseries.DatetimeIndex.time_to_date</td>\n",
" <td>'tz_local'</td>\n",
" <td>6.034763</td>\n",
" <td>6.034763</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5600</th>\n",
" <td>replace.ReplaceDict.time_replace_series</td>\n",
" <td>False</td>\n",
" <td>5.999582</td>\n",
" <td>5.999582</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7509</th>\n",
" <td>timeseries.DatetimeIndex.time_to_time</td>\n",
" <td>'tz_local'</td>\n",
" <td>5.915814</td>\n",
" <td>5.915814</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5599</th>\n",
" <td>replace.ReplaceDict.time_replace_series</td>\n",
" <td>True</td>\n",
" <td>5.846009</td>\n",
" <td>5.846009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7504</th>\n",
" <td>timeseries.DatetimeIndex.time_to_pydatetime</td>\n",
" <td>'tz_local'</td>\n",
" <td>5.641824</td>\n",
" <td>5.641824</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4292</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'max'</td>\n",
" <td>5.536402</td>\n",
" <td>5.536402</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4291</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'min'</td>\n",
" <td>5.418401</td>\n",
" <td>5.418401</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5546</th>\n",
" <td>plotting.FramePlotting.time_frame_plot</td>\n",
" <td>'area'</td>\n",
" <td>5.153195</td>\n",
" <td>5.153195</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5502</th>\n",
" <td>multiindex_object.SetOperations.time_operation</td>\n",
" <td>'monotonic'-'datetime'-'union'</td>\n",
" <td>5.078759</td>\n",
" <td>5.078759</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7494</th>\n",
" <td>timeseries.DatetimeIndex.time_timeseries_is_month_start</td>\n",
" <td>'tz_local'</td>\n",
" <td>5.060452</td>\n",
" <td>5.060452</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7521</th>\n",
" <td>timeseries.Iteration.time_iter</td>\n",
" <td>&lt;function timedelta_range at 0x7f34437b89d0&gt;</td>\n",
" <td>4.736471</td>\n",
" <td>4.736471</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2678</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_field</td>\n",
" <td>'uint'-'describe'-'direct'-10</td>\n",
" <td>4.137032</td>\n",
" <td>4.137032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4306</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'string[python]'-'var'</td>\n",
" <td>4.093552</td>\n",
" <td>4.093552</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" name \\\n",
"3222 groupby.GroupByMethods.time_dtype_as_group \n",
"4038 groupby.GroupByMethods.time_dtype_as_group \n",
"2950 groupby.GroupByMethods.time_dtype_as_group \n",
"3221 groupby.GroupByMethods.time_dtype_as_group \n",
"4303 groupby.String.time_str_func \n",
"4302 groupby.String.time_str_func \n",
"4293 groupby.String.time_str_func \n",
"2949 groupby.GroupByMethods.time_dtype_as_group \n",
"4300 groupby.String.time_str_func \n",
"4294 groupby.String.time_str_func \n",
"4298 groupby.String.time_str_func \n",
"4037 groupby.GroupByMethods.time_dtype_as_group \n",
"4299 groupby.String.time_str_func \n",
"4289 groupby.String.time_str_func \n",
"7489 timeseries.DatetimeIndex.time_normalize \n",
"5522 package.TimeImport.time_import \n",
"3220 groupby.GroupByMethods.time_dtype_as_group \n",
"7499 timeseries.DatetimeIndex.time_to_date \n",
"5600 replace.ReplaceDict.time_replace_series \n",
"7509 timeseries.DatetimeIndex.time_to_time \n",
"5599 replace.ReplaceDict.time_replace_series \n",
"7504 timeseries.DatetimeIndex.time_to_pydatetime \n",
"4292 groupby.String.time_str_func \n",
"4291 groupby.String.time_str_func \n",
"5546 plotting.FramePlotting.time_frame_plot \n",
"5502 multiindex_object.SetOperations.time_operation \n",
"7494 timeseries.DatetimeIndex.time_timeseries_is_month_start \n",
"7521 timeseries.Iteration.time_iter \n",
"2678 groupby.GroupByMethods.time_dtype_as_field \n",
"4306 groupby.String.time_str_func \n",
"\n",
" params time total_time \n",
"3222 'float'-'describe'-'direct'-10 24.076902 24.076902 \n",
"4038 'uint'-'describe'-'direct'-10 16.194978 16.194978 \n",
"2950 'int'-'describe'-'direct'-10 15.590451 15.590451 \n",
"3221 'float'-'describe'-'direct'-5 13.073884 13.073884 \n",
"4303 'string[python]'-'max' 12.792118 12.792118 \n",
"4302 'string[python]'-'min' 11.113345 11.113345 \n",
"4293 'str'-'mean' 9.893737 9.893737 \n",
"2949 'int'-'describe'-'direct'-5 8.977205 8.977205 \n",
"4300 'string[python]'-'sum' 7.758854 7.758854 \n",
"4294 'str'-'median' 7.410970 7.410970 \n",
"4298 'str'-'any' 7.178809 7.178809 \n",
"4037 'uint'-'describe'-'direct'-5 7.140640 7.140640 \n",
"4299 'str'-'all' 6.905889 6.905889 \n",
"4289 'str'-'sum' 6.729190 6.729190 \n",
"7489 'tz_local' 6.453705 6.453705 \n",
"5522 6.367532 6.367532 \n",
"3220 'float'-'describe'-'direct'-2 6.159515 6.159515 \n",
"7499 'tz_local' 6.034763 6.034763 \n",
"5600 False 5.999582 5.999582 \n",
"7509 'tz_local' 5.915814 5.915814 \n",
"5599 True 5.846009 5.846009 \n",
"7504 'tz_local' 5.641824 5.641824 \n",
"4292 'str'-'max' 5.536402 5.536402 \n",
"4291 'str'-'min' 5.418401 5.418401 \n",
"5546 'area' 5.153195 5.153195 \n",
"5502 'monotonic'-'datetime'-'union' 5.078759 5.078759 \n",
"7494 'tz_local' 5.060452 5.060452 \n",
"7521 <function timedelta_range at 0x7f34437b89d0> 4.736471 4.736471 \n",
"2678 'uint'-'describe'-'direct'-10 4.137032 4.137032 \n",
"4306 'string[python]'-'var' 4.093552 4.093552 "
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.sort_values(\"time\", ascending=False).head(30)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Slowest benchmark to run (total time with repeat/number) (NOTE this is the same in this case, since I ran asv without repetitions):"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" <th>params</th>\n",
" <th>time</th>\n",
" <th>total_time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>3222</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'float'-'describe'-'direct'-10</td>\n",
" <td>24.076902</td>\n",
" <td>24.076902</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4038</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'uint'-'describe'-'direct'-10</td>\n",
" <td>16.194978</td>\n",
" <td>16.194978</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2950</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'int'-'describe'-'direct'-10</td>\n",
" <td>15.590451</td>\n",
" <td>15.590451</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3221</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'float'-'describe'-'direct'-5</td>\n",
" <td>13.073884</td>\n",
" <td>13.073884</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4303</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'string[python]'-'max'</td>\n",
" <td>12.792118</td>\n",
" <td>12.792118</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4302</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'string[python]'-'min'</td>\n",
" <td>11.113345</td>\n",
" <td>11.113345</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4293</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'mean'</td>\n",
" <td>9.893737</td>\n",
" <td>9.893737</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2949</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'int'-'describe'-'direct'-5</td>\n",
" <td>8.977205</td>\n",
" <td>8.977205</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4300</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'string[python]'-'sum'</td>\n",
" <td>7.758854</td>\n",
" <td>7.758854</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4294</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'median'</td>\n",
" <td>7.410970</td>\n",
" <td>7.410970</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4298</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'any'</td>\n",
" <td>7.178809</td>\n",
" <td>7.178809</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4037</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'uint'-'describe'-'direct'-5</td>\n",
" <td>7.140640</td>\n",
" <td>7.140640</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4299</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'all'</td>\n",
" <td>6.905889</td>\n",
" <td>6.905889</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4289</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'sum'</td>\n",
" <td>6.729190</td>\n",
" <td>6.729190</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7489</th>\n",
" <td>timeseries.DatetimeIndex.time_normalize</td>\n",
" <td>'tz_local'</td>\n",
" <td>6.453705</td>\n",
" <td>6.453705</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5522</th>\n",
" <td>package.TimeImport.time_import</td>\n",
" <td></td>\n",
" <td>6.367532</td>\n",
" <td>6.367532</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3220</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>'float'-'describe'-'direct'-2</td>\n",
" <td>6.159515</td>\n",
" <td>6.159515</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7499</th>\n",
" <td>timeseries.DatetimeIndex.time_to_date</td>\n",
" <td>'tz_local'</td>\n",
" <td>6.034763</td>\n",
" <td>6.034763</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5600</th>\n",
" <td>replace.ReplaceDict.time_replace_series</td>\n",
" <td>False</td>\n",
" <td>5.999582</td>\n",
" <td>5.999582</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7509</th>\n",
" <td>timeseries.DatetimeIndex.time_to_time</td>\n",
" <td>'tz_local'</td>\n",
" <td>5.915814</td>\n",
" <td>5.915814</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5599</th>\n",
" <td>replace.ReplaceDict.time_replace_series</td>\n",
" <td>True</td>\n",
" <td>5.846009</td>\n",
" <td>5.846009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7504</th>\n",
" <td>timeseries.DatetimeIndex.time_to_pydatetime</td>\n",
" <td>'tz_local'</td>\n",
" <td>5.641824</td>\n",
" <td>5.641824</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4292</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'max'</td>\n",
" <td>5.536402</td>\n",
" <td>5.536402</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4291</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'str'-'min'</td>\n",
" <td>5.418401</td>\n",
" <td>5.418401</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5546</th>\n",
" <td>plotting.FramePlotting.time_frame_plot</td>\n",
" <td>'area'</td>\n",
" <td>5.153195</td>\n",
" <td>5.153195</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5502</th>\n",
" <td>multiindex_object.SetOperations.time_operation</td>\n",
" <td>'monotonic'-'datetime'-'union'</td>\n",
" <td>5.078759</td>\n",
" <td>5.078759</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7494</th>\n",
" <td>timeseries.DatetimeIndex.time_timeseries_is_month_start</td>\n",
" <td>'tz_local'</td>\n",
" <td>5.060452</td>\n",
" <td>5.060452</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7521</th>\n",
" <td>timeseries.Iteration.time_iter</td>\n",
" <td>&lt;function timedelta_range at 0x7f34437b89d0&gt;</td>\n",
" <td>4.736471</td>\n",
" <td>4.736471</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2678</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_field</td>\n",
" <td>'uint'-'describe'-'direct'-10</td>\n",
" <td>4.137032</td>\n",
" <td>4.137032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4306</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>'string[python]'-'var'</td>\n",
" <td>4.093552</td>\n",
" <td>4.093552</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" name \\\n",
"3222 groupby.GroupByMethods.time_dtype_as_group \n",
"4038 groupby.GroupByMethods.time_dtype_as_group \n",
"2950 groupby.GroupByMethods.time_dtype_as_group \n",
"3221 groupby.GroupByMethods.time_dtype_as_group \n",
"4303 groupby.String.time_str_func \n",
"4302 groupby.String.time_str_func \n",
"4293 groupby.String.time_str_func \n",
"2949 groupby.GroupByMethods.time_dtype_as_group \n",
"4300 groupby.String.time_str_func \n",
"4294 groupby.String.time_str_func \n",
"4298 groupby.String.time_str_func \n",
"4037 groupby.GroupByMethods.time_dtype_as_group \n",
"4299 groupby.String.time_str_func \n",
"4289 groupby.String.time_str_func \n",
"7489 timeseries.DatetimeIndex.time_normalize \n",
"5522 package.TimeImport.time_import \n",
"3220 groupby.GroupByMethods.time_dtype_as_group \n",
"7499 timeseries.DatetimeIndex.time_to_date \n",
"5600 replace.ReplaceDict.time_replace_series \n",
"7509 timeseries.DatetimeIndex.time_to_time \n",
"5599 replace.ReplaceDict.time_replace_series \n",
"7504 timeseries.DatetimeIndex.time_to_pydatetime \n",
"4292 groupby.String.time_str_func \n",
"4291 groupby.String.time_str_func \n",
"5546 plotting.FramePlotting.time_frame_plot \n",
"5502 multiindex_object.SetOperations.time_operation \n",
"7494 timeseries.DatetimeIndex.time_timeseries_is_month_start \n",
"7521 timeseries.Iteration.time_iter \n",
"2678 groupby.GroupByMethods.time_dtype_as_field \n",
"4306 groupby.String.time_str_func \n",
"\n",
" params time total_time \n",
"3222 'float'-'describe'-'direct'-10 24.076902 24.076902 \n",
"4038 'uint'-'describe'-'direct'-10 16.194978 16.194978 \n",
"2950 'int'-'describe'-'direct'-10 15.590451 15.590451 \n",
"3221 'float'-'describe'-'direct'-5 13.073884 13.073884 \n",
"4303 'string[python]'-'max' 12.792118 12.792118 \n",
"4302 'string[python]'-'min' 11.113345 11.113345 \n",
"4293 'str'-'mean' 9.893737 9.893737 \n",
"2949 'int'-'describe'-'direct'-5 8.977205 8.977205 \n",
"4300 'string[python]'-'sum' 7.758854 7.758854 \n",
"4294 'str'-'median' 7.410970 7.410970 \n",
"4298 'str'-'any' 7.178809 7.178809 \n",
"4037 'uint'-'describe'-'direct'-5 7.140640 7.140640 \n",
"4299 'str'-'all' 6.905889 6.905889 \n",
"4289 'str'-'sum' 6.729190 6.729190 \n",
"7489 'tz_local' 6.453705 6.453705 \n",
"5522 6.367532 6.367532 \n",
"3220 'float'-'describe'-'direct'-2 6.159515 6.159515 \n",
"7499 'tz_local' 6.034763 6.034763 \n",
"5600 False 5.999582 5.999582 \n",
"7509 'tz_local' 5.915814 5.915814 \n",
"5599 True 5.846009 5.846009 \n",
"7504 'tz_local' 5.641824 5.641824 \n",
"4292 'str'-'max' 5.536402 5.536402 \n",
"4291 'str'-'min' 5.418401 5.418401 \n",
"5546 'area' 5.153195 5.153195 \n",
"5502 'monotonic'-'datetime'-'union' 5.078759 5.078759 \n",
"7494 'tz_local' 5.060452 5.060452 \n",
"7521 <function timedelta_range at 0x7f34437b89d0> 4.736471 4.736471 \n",
"2678 'uint'-'describe'-'direct'-10 4.137032 4.137032 \n",
"4306 'string[python]'-'var' 4.093552 4.093552 "
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.sort_values(\"total_time\", ascending=False).head(30)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Slowest benchmarks per benchmarks function (total of all parametrizations):"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" <th>total_time</th>\n",
" <th>n_params</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>316</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_group</td>\n",
" <td>143.483201</td>\n",
" <td>1360</td>\n",
" </tr>\n",
" <tr>\n",
" <th>339</th>\n",
" <td>groupby.String.time_str_func</td>\n",
" <td>110.600805</td>\n",
" <td>22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>315</th>\n",
" <td>groupby.GroupByMethods.time_dtype_as_field</td>\n",
" <td>38.998448</td>\n",
" <td>1360</td>\n",
" </tr>\n",
" <tr>\n",
" <th>633</th>\n",
" <td>multiindex_object.SetOperations.time_operation</td>\n",
" <td>19.090908</td>\n",
" <td>18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>729</th>\n",
" <td>rolling.NumbaEngine.time_expanding_apply</td>\n",
" <td>17.712175</td>\n",
" <td>160</td>\n",
" </tr>\n",
" <tr>\n",
" <th>655</th>\n",
" <td>plotting.FramePlotting.time_frame_plot</td>\n",
" <td>15.624909</td>\n",
" <td>9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>898</th>\n",
" <td>tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr</td>\n",
" <td>14.146682</td>\n",
" <td>450</td>\n",
" </tr>\n",
" <tr>\n",
" <th>680</th>\n",
" <td>replace.ReplaceDict.time_replace_series</td>\n",
" <td>11.845591</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>952</th>\n",
" <td>tslibs.tslib.TimeIntsToPydatetime.time_ints_to_pydatetime</td>\n",
" <td>7.823503</td>\n",
" <td>120</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>algos.isin.IsInLongSeriesLookUpDominates.time_isin</td>\n",
" <td>7.819284</td>\n",
" <td>56</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>algos.isin.IsInLongSeriesValuesDominate.time_isin</td>\n",
" <td>7.573969</td>\n",
" <td>14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>870</th>\n",
" <td>timeseries.Iteration.time_iter</td>\n",
" <td>7.412421</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>606</th>\n",
" <td>join_merge.MergeAsof.time_multiby</td>\n",
" <td>6.661364</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>863</th>\n",
" <td>timeseries.DatetimeIndex.time_normalize</td>\n",
" <td>6.479399</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>639</th>\n",
" <td>package.TimeImport.time_import</td>\n",
" <td>6.367532</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>865</th>\n",
" <td>timeseries.DatetimeIndex.time_to_date</td>\n",
" <td>6.134767</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>867</th>\n",
" <td>timeseries.DatetimeIndex.time_to_time</td>\n",
" <td>6.062254</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>900</th>\n",
" <td>tslibs.resolution.TimeResolution.time_get_resolution</td>\n",
" <td>5.948664</td>\n",
" <td>180</td>\n",
" </tr>\n",
" <tr>\n",
" <th>866</th>\n",
" <td>timeseries.DatetimeIndex.time_to_pydatetime</td>\n",
" <td>5.832068</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>864</th>\n",
" <td>timeseries.DatetimeIndex.time_timeseries_is_month_start</td>\n",
" <td>5.088461</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>783</th>\n",
" <td>stat_ops.FrameMultiIndexOps.time_op</td>\n",
" <td>4.623196</td>\n",
" <td>30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>791</th>\n",
" <td>strings.Dummies.time_get_dummies</td>\n",
" <td>4.467068</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>882</th>\n",
" <td>tslibs.fields.TimeGetStartEndField.time_get_start_end_field</td>\n",
" <td>4.408291</td>\n",
" <td>270</td>\n",
" </tr>\n",
" <tr>\n",
" <th>736</th>\n",
" <td>rolling.TableMethod.time_apply</td>\n",
" <td>4.256446</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>657</th>\n",
" <td>plotting.SeriesPlotting.time_series_plot</td>\n",
" <td>4.156989</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>550</th>\n",
" <td>io.json.ToJSON.time_to_json</td>\n",
" <td>4.135763</td>\n",
" <td>25</td>\n",
" </tr>\n",
" <tr>\n",
" <th>592</th>\n",
" <td>join_merge.I8Merge.time_i8merge</td>\n",
" <td>3.956258</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>661</th>\n",
" <td>plotting.TimeseriesPlotting.time_plot_table</td>\n",
" <td>3.720066</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>735</th>\n",
" <td>rolling.Rank.time_rank</td>\n",
" <td>3.689770</td>\n",
" <td>96</td>\n",
" </tr>\n",
" <tr>\n",
" <th>350</th>\n",
" <td>groupby.TransformEngine.time_dataframe_numba</td>\n",
" <td>3.641100</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>52</th>\n",
" <td>arithmetic.OffsetArrayArithmetic.time_add_series_offset</td>\n",
" <td>3.571453</td>\n",
" <td>22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>558</th>\n",
" <td>io.json.ToJSONWide.time_to_json</td>\n",
" <td>3.499559</td>\n",
" <td>25</td>\n",
" </tr>\n",
" <tr>\n",
" <th>51</th>\n",
" <td>arithmetic.OffsetArrayArithmetic.time_add_dti_offset</td>\n",
" <td>3.473622</td>\n",
" <td>22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>491</th>\n",
" <td>inference.ToNumericDowncast.time_downcast</td>\n",
" <td>3.383582</td>\n",
" <td>30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>559</th>\n",
" <td>io.json.ToJSONWide.time_to_json_wide</td>\n",
" <td>3.346633</td>\n",
" <td>25</td>\n",
" </tr>\n",
" <tr>\n",
" <th>551</th>\n",
" <td>io.json.ToJSONISO.time_iso_format</td>\n",
" <td>3.132554</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>522</th>\n",
" <td>io.csv.ToCSVIndexes.time_head_of_multiindex</td>\n",
" <td>2.821571</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>779</th>\n",
" <td>stat_ops.Correlation.time_corr_wide_nans</td>\n",
" <td>2.732602</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>611</th>\n",
" <td>join_merge.MergeCategoricals.time_merge_object</td>\n",
" <td>2.711899</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>352</th>\n",
" <td>groupby.TransformEngine.time_series_numba</td>\n",
" <td>2.677770</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>284</th>\n",
" <td>groupby.AggEngine.time_dataframe_numba</td>\n",
" <td>2.644774</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>algos.isin.IsinWithRandomFloat.time_isin</td>\n",
" <td>2.588593</td>\n",
" <td>32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>546</th>\n",
" <td>io.json.ReadJSON.time_read_json</td>\n",
" <td>2.447450</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>276</th>\n",
" <td>gil.ParallelGroupbyMethods.time_loop</td>\n",
" <td>2.391681</td>\n",
" <td>24</td>\n",
" </tr>\n",
" <tr>\n",
" <th>830</th>\n",
" <td>strings.Methods.time_wrap</td>\n",
" <td>2.333387</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>545</th>\n",
" <td>io.json.NormalizeJSON.time_normalize_json</td>\n",
" <td>2.098322</td>\n",
" <td>25</td>\n",
" </tr>\n",
" <tr>\n",
" <th>717</th>\n",
" <td>rolling.Apply.time_rolling</td>\n",
" <td>2.069862</td>\n",
" <td>48</td>\n",
" </tr>\n",
" <tr>\n",
" <th>575</th>\n",
" <td>io.stata.StataMissing.time_write_stata</td>\n",
" <td>2.035575</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>730</th>\n",
" <td>rolling.NumbaEngine.time_rolling_apply</td>\n",
" <td>1.988849</td>\n",
" <td>160</td>\n",
" </tr>\n",
" <tr>\n",
" <th>734</th>\n",
" <td>rolling.Quantile.time_quantile</td>\n",
" <td>1.933930</td>\n",
" <td>120</td>\n",
" </tr>\n",
" <tr>\n",
" <th>278</th>\n",
" <td>gil.ParallelGroups.time_get_groups</td>\n",
" <td>1.926062</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>598</th>\n",
" <td>join_merge.JoinIndex.time_left_outer_join_index</td>\n",
" <td>1.891163</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>778</th>\n",
" <td>stat_ops.Correlation.time_corr_wide</td>\n",
" <td>1.879236</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>356</th>\n",
" <td>hash_functions.NumericSeriesIndexingShuffled.time_loc_slice</td>\n",
" <td>1.865167</td>\n",
" <td>15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>690</th>\n",
" <td>reshape.Cut.time_cut_interval</td>\n",
" <td>1.847030</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>737</th>\n",
" <td>rolling.TableMethod.time_ewm_mean</td>\n",
" <td>1.831205</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>731</th>\n",
" <td>rolling.NumbaEngine.time_rolling_methods</td>\n",
" <td>1.803949</td>\n",
" <td>160</td>\n",
" </tr>\n",
" <tr>\n",
" <th>787</th>\n",
" <td>stat_ops.SeriesMultiIndexOps.time_op</td>\n",
" <td>1.792530</td>\n",
" <td>30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>899</th>\n",
" <td>tslibs.period.TimePeriodArrToDT64Arr.time_periodarray_to_dt64arr</td>\n",
" <td>1.778175</td>\n",
" <td>75</td>\n",
" </tr>\n",
" <tr>\n",
" <th>286</th>\n",
" <td>groupby.AggEngine.time_series_numba</td>\n",
" <td>1.745283</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>656</th>\n",
" <td>plotting.Misc.time_plot_andrews_curves</td>\n",
" <td>1.621093</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>781</th>\n",
" <td>stat_ops.Correlation.time_corrwith_rows</td>\n",
" <td>1.560737</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>222</th>\n",
" <td>frame_methods.Iteration.time_itertuples_to_list</td>\n",
" <td>1.533501</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>682</th>\n",
" <td>replace.ReplaceList.time_replace_list_one_match</td>\n",
" <td>1.530685</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>610</th>\n",
" <td>join_merge.MergeCategoricals.time_merge_cat</td>\n",
" <td>1.495101</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>201</th>\n",
" <td>frame_methods.Fillna.time_frame_fillna</td>\n",
" <td>1.490996</td>\n",
" <td>32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>526</th>\n",
" <td>io.excel.WriteExcel.time_write_excel</td>\n",
" <td>1.471233</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>547</th>\n",
" <td>io.json.ReadJSONLines.time_read_json_lines</td>\n",
" <td>1.449778</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>580</th>\n",
" <td>io.style.Render.time_tooltips_render</td>\n",
" <td>1.436663</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>784</th>\n",
" <td>stat_ops.FrameOps.time_op</td>\n",
" <td>1.421569</td>\n",
" <td>60</td>\n",
" </tr>\n",
" <tr>\n",
" <th>789</th>\n",
" <td>strings.Cat.time_cat</td>\n",
" <td>1.370791</td>\n",
" <td>24</td>\n",
" </tr>\n",
" <tr>\n",
" <th>881</th>\n",
" <td>tslibs.fields.TimeGetDateField.time_get_date_field</td>\n",
" <td>1.347245</td>\n",
" <td>70</td>\n",
" </tr>\n",
" <tr>\n",
" <th>525</th>\n",
" <td>io.excel.ReadExcel.time_read_excel</td>\n",
" <td>1.317574</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>355</th>\n",
" <td>hash_functions.NumericSeriesIndexing.time_loc_slice</td>\n",
" <td>1.311729</td>\n",
" <td>15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>573</th>\n",
" <td>io.stata.Stata.time_write_stata</td>\n",
" <td>1.297710</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>574</th>\n",
" <td>io.stata.StataMissing.time_read_stata</td>\n",
" <td>1.287333</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>793</th>\n",
" <td>strings.Extract.time_extract_single_group</td>\n",
" <td>1.283894</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>277</th>\n",
" <td>gil.ParallelGroupbyMethods.time_parallel</td>\n",
" <td>1.278034</td>\n",
" <td>24</td>\n",
" </tr>\n",
" <tr>\n",
" <th>835</th>\n",
" <td>strings.Split.time_split</td>\n",
" <td>1.247314</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>576</th>\n",
" <td>io.style.Render.time_apply_format_hide_render</td>\n",
" <td>1.245846</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>738</th>\n",
" <td>rolling.VariableWindowMethods.time_rolling</td>\n",
" <td>1.235087</td>\n",
" <td>108</td>\n",
" </tr>\n",
" <tr>\n",
" <th>548</th>\n",
" <td>io.json.ReadJSONLines.time_read_json_lines_concat</td>\n",
" <td>1.207738</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>604</th>\n",
" <td>join_merge.MergeAsof.time_by_int</td>\n",
" <td>1.205289</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>algos.isin.IsinAlmostFullWithRandomInt.time_isin</td>\n",
" <td>1.160582</td>\n",
" <td>88</td>\n",
" </tr>\n",
" <tr>\n",
" <th>605</th>\n",
" <td>join_merge.MergeAsof.time_by_object</td>\n",
" <td>1.146129</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>algos.isin.IsinWithArange.time_isin</td>\n",
" <td>1.107429</td>\n",
" <td>36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>726</th>\n",
" <td>rolling.GroupbyEWMEngine.time_groupby_mean</td>\n",
" <td>1.094124</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>630</th>\n",
" <td>multiindex_object.Integer.time_get_indexer_and_backfill</td>\n",
" <td>1.085625</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>219</th>\n",
" <td>frame_methods.Iteration.time_itertuples_raw_tuples_to_list</td>\n",
" <td>1.067254</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>577</th>\n",
" <td>io.style.Render.time_apply_render</td>\n",
" <td>1.050519</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>215</th>\n",
" <td>frame_methods.Iteration.time_itertuples</td>\n",
" <td>1.031311</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>578</th>\n",
" <td>io.style.Render.time_classes_render</td>\n",
" <td>1.021087</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>523</th>\n",
" <td>io.csv.ToCSVIndexes.time_multiindex</td>\n",
" <td>1.019361</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>arithmetic.IntFrameWithScalar.time_frame_op_with_scalar</td>\n",
" <td>1.016559</td>\n",
" <td>104</td>\n",
" </tr>\n",
" <tr>\n",
" <th>455</th>\n",
" <td>indexing_engines.NumericEngineIndexing.time_get_loc_near_middle</td>\n",
" <td>1.005080</td>\n",
" <td>108</td>\n",
" </tr>\n",
" <tr>\n",
" <th>579</th>\n",
" <td>io.style.Render.time_format_render</td>\n",
" <td>0.997092</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>631</th>\n",
" <td>multiindex_object.Integer.time_get_indexer_and_pad</td>\n",
" <td>0.977746</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>524</th>\n",
" <td>io.csv.ToCSVIndexes.time_standard_index</td>\n",
" <td>0.933731</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>634</th>\n",
" <td>multiindex_object.Sortlevel.time_sortlevel_int64</td>\n",
" <td>0.913792</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>620</th>\n",
" <td>multiindex_object.Duplicated.time_duplicated</td>\n",
" <td>0.874728</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" name \\\n",
"316 groupby.GroupByMethods.time_dtype_as_group \n",
"339 groupby.String.time_str_func \n",
"315 groupby.GroupByMethods.time_dtype_as_field \n",
"633 multiindex_object.SetOperations.time_operation \n",
"729 rolling.NumbaEngine.time_expanding_apply \n",
"655 plotting.FramePlotting.time_frame_plot \n",
"898 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr \n",
"680 replace.ReplaceDict.time_replace_series \n",
"952 tslibs.tslib.TimeIntsToPydatetime.time_ints_to_pydatetime \n",
"17 algos.isin.IsInLongSeriesLookUpDominates.time_isin \n",
"18 algos.isin.IsInLongSeriesValuesDominate.time_isin \n",
"870 timeseries.Iteration.time_iter \n",
"606 join_merge.MergeAsof.time_multiby \n",
"863 timeseries.DatetimeIndex.time_normalize \n",
"639 package.TimeImport.time_import \n",
"865 timeseries.DatetimeIndex.time_to_date \n",
"867 timeseries.DatetimeIndex.time_to_time \n",
"900 tslibs.resolution.TimeResolution.time_get_resolution \n",
"866 timeseries.DatetimeIndex.time_to_pydatetime \n",
"864 timeseries.DatetimeIndex.time_timeseries_is_month_start \n",
"783 stat_ops.FrameMultiIndexOps.time_op \n",
"791 strings.Dummies.time_get_dummies \n",
"882 tslibs.fields.TimeGetStartEndField.time_get_start_end_field \n",
"736 rolling.TableMethod.time_apply \n",
"657 plotting.SeriesPlotting.time_series_plot \n",
"550 io.json.ToJSON.time_to_json \n",
"592 join_merge.I8Merge.time_i8merge \n",
"661 plotting.TimeseriesPlotting.time_plot_table \n",
"735 rolling.Rank.time_rank \n",
"350 groupby.TransformEngine.time_dataframe_numba \n",
"52 arithmetic.OffsetArrayArithmetic.time_add_series_offset \n",
"558 io.json.ToJSONWide.time_to_json \n",
"51 arithmetic.OffsetArrayArithmetic.time_add_dti_offset \n",
"491 inference.ToNumericDowncast.time_downcast \n",
"559 io.json.ToJSONWide.time_to_json_wide \n",
"551 io.json.ToJSONISO.time_iso_format \n",
"522 io.csv.ToCSVIndexes.time_head_of_multiindex \n",
"779 stat_ops.Correlation.time_corr_wide_nans \n",
"611 join_merge.MergeCategoricals.time_merge_object \n",
"352 groupby.TransformEngine.time_series_numba \n",
"284 groupby.AggEngine.time_dataframe_numba \n",
"23 algos.isin.IsinWithRandomFloat.time_isin \n",
"546 io.json.ReadJSON.time_read_json \n",
"276 gil.ParallelGroupbyMethods.time_loop \n",
"830 strings.Methods.time_wrap \n",
"545 io.json.NormalizeJSON.time_normalize_json \n",
"717 rolling.Apply.time_rolling \n",
"575 io.stata.StataMissing.time_write_stata \n",
"730 rolling.NumbaEngine.time_rolling_apply \n",
"734 rolling.Quantile.time_quantile \n",
"278 gil.ParallelGroups.time_get_groups \n",
"598 join_merge.JoinIndex.time_left_outer_join_index \n",
"778 stat_ops.Correlation.time_corr_wide \n",
"356 hash_functions.NumericSeriesIndexingShuffled.time_loc_slice \n",
"690 reshape.Cut.time_cut_interval \n",
"737 rolling.TableMethod.time_ewm_mean \n",
"731 rolling.NumbaEngine.time_rolling_methods \n",
"787 stat_ops.SeriesMultiIndexOps.time_op \n",
"899 tslibs.period.TimePeriodArrToDT64Arr.time_periodarray_to_dt64arr \n",
"286 groupby.AggEngine.time_series_numba \n",
"656 plotting.Misc.time_plot_andrews_curves \n",
"781 stat_ops.Correlation.time_corrwith_rows \n",
"222 frame_methods.Iteration.time_itertuples_to_list \n",
"682 replace.ReplaceList.time_replace_list_one_match \n",
"610 join_merge.MergeCategoricals.time_merge_cat \n",
"201 frame_methods.Fillna.time_frame_fillna \n",
"526 io.excel.WriteExcel.time_write_excel \n",
"547 io.json.ReadJSONLines.time_read_json_lines \n",
"580 io.style.Render.time_tooltips_render \n",
"784 stat_ops.FrameOps.time_op \n",
"789 strings.Cat.time_cat \n",
"881 tslibs.fields.TimeGetDateField.time_get_date_field \n",
"525 io.excel.ReadExcel.time_read_excel \n",
"355 hash_functions.NumericSeriesIndexing.time_loc_slice \n",
"573 io.stata.Stata.time_write_stata \n",
"574 io.stata.StataMissing.time_read_stata \n",
"793 strings.Extract.time_extract_single_group \n",
"277 gil.ParallelGroupbyMethods.time_parallel \n",
"835 strings.Split.time_split \n",
"576 io.style.Render.time_apply_format_hide_render \n",
"738 rolling.VariableWindowMethods.time_rolling \n",
"548 io.json.ReadJSONLines.time_read_json_lines_concat \n",
"604 join_merge.MergeAsof.time_by_int \n",
"20 algos.isin.IsinAlmostFullWithRandomInt.time_isin \n",
"605 join_merge.MergeAsof.time_by_object \n",
"21 algos.isin.IsinWithArange.time_isin \n",
"726 rolling.GroupbyEWMEngine.time_groupby_mean \n",
"630 multiindex_object.Integer.time_get_indexer_and_backfill \n",
"219 frame_methods.Iteration.time_itertuples_raw_tuples_to_list \n",
"577 io.style.Render.time_apply_render \n",
"215 frame_methods.Iteration.time_itertuples \n",
"578 io.style.Render.time_classes_render \n",
"523 io.csv.ToCSVIndexes.time_multiindex \n",
"42 arithmetic.IntFrameWithScalar.time_frame_op_with_scalar \n",
"455 indexing_engines.NumericEngineIndexing.time_get_loc_near_middle \n",
"579 io.style.Render.time_format_render \n",
"631 multiindex_object.Integer.time_get_indexer_and_pad \n",
"524 io.csv.ToCSVIndexes.time_standard_index \n",
"634 multiindex_object.Sortlevel.time_sortlevel_int64 \n",
"620 multiindex_object.Duplicated.time_duplicated \n",
"\n",
" total_time n_params \n",
"316 143.483201 1360 \n",
"339 110.600805 22 \n",
"315 38.998448 1360 \n",
"633 19.090908 18 \n",
"729 17.712175 160 \n",
"655 15.624909 9 \n",
"898 14.146682 450 \n",
"680 11.845591 2 \n",
"952 7.823503 120 \n",
"17 7.819284 56 \n",
"18 7.573969 14 \n",
"870 7.412421 3 \n",
"606 6.661364 6 \n",
"863 6.479399 5 \n",
"639 6.367532 1 \n",
"865 6.134767 5 \n",
"867 6.062254 5 \n",
"900 5.948664 180 \n",
"866 5.832068 5 \n",
"864 5.088461 5 \n",
"783 4.623196 30 \n",
"791 4.467068 3 \n",
"882 4.408291 270 \n",
"736 4.256446 2 \n",
"657 4.156989 7 \n",
"550 4.135763 25 \n",
"592 3.956258 4 \n",
"661 3.720066 1 \n",
"735 3.689770 96 \n",
"350 3.641100 2 \n",
"52 3.571453 22 \n",
"558 3.499559 25 \n",
"51 3.473622 22 \n",
"491 3.383582 30 \n",
"559 3.346633 25 \n",
"551 3.132554 5 \n",
"522 2.821571 1 \n",
"779 2.732602 3 \n",
"611 2.711899 1 \n",
"352 2.677770 2 \n",
"284 2.644774 2 \n",
"23 2.588593 32 \n",
"546 2.447450 6 \n",
"276 2.391681 24 \n",
"830 2.333387 3 \n",
"545 2.098322 25 \n",
"717 2.069862 48 \n",
"575 2.035575 7 \n",
"730 1.988849 160 \n",
"734 1.933930 120 \n",
"278 1.926062 3 \n",
"598 1.891163 1 \n",
"778 1.879236 3 \n",
"356 1.865167 15 \n",
"690 1.847030 3 \n",
"737 1.831205 2 \n",
"731 1.803949 160 \n",
"787 1.792530 30 \n",
"899 1.778175 75 \n",
"286 1.745283 2 \n",
"656 1.621093 1 \n",
"781 1.560737 3 \n",
"222 1.533501 1 \n",
"682 1.530685 2 \n",
"610 1.495101 1 \n",
"201 1.490996 32 \n",
"526 1.471233 3 \n",
"547 1.449778 2 \n",
"580 1.436663 6 \n",
"784 1.421569 60 \n",
"789 1.370791 24 \n",
"881 1.347245 70 \n",
"525 1.317574 3 \n",
"355 1.311729 15 \n",
"573 1.297710 7 \n",
"574 1.287333 7 \n",
"793 1.283894 6 \n",
"277 1.278034 24 \n",
"835 1.247314 6 \n",
"576 1.245846 6 \n",
"738 1.235087 108 \n",
"548 1.207738 2 \n",
"604 1.205289 6 \n",
"20 1.160582 88 \n",
"605 1.146129 6 \n",
"21 1.107429 36 \n",
"726 1.094124 2 \n",
"630 1.085625 1 \n",
"219 1.067254 1 \n",
"577 1.050519 6 \n",
"215 1.031311 1 \n",
"578 1.021087 6 \n",
"523 1.019361 1 \n",
"42 1.016559 104 \n",
"455 1.005080 108 \n",
"579 0.997092 6 \n",
"631 0.977746 1 \n",
"524 0.933731 1 \n",
"634 0.913792 1 \n",
"620 0.874728 1 "
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.groupby(\"name\")['total_time'].agg(total_time=\"sum\", n_params=\"size\").reset_index().sort_values(\"total_time\", ascending=False).head(100)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python (dev)",
"language": "python",
"name": "dev"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment