6. Performance

StaticFrame benchmarks its performance with one-to-one comparisons to functionally equivalent Pandas operations. Such measures of performance are poor indicators of real-world use-cases, but provide some insight into general run-time characteristics.

6.1. StaticFrame v. Pandas

The following tables illustrate absolute run-times (“pd”, “sf”, where smaller is better) and run-time ratios (“pd_faster”, “sf_faster”, where larger is better) for functionally equivalent operations. Where a value is given for a run-time ratio, that package is faster; e.g., where “sf_faster” is 4.7, that operation is 4.7 times faster in StaticFrame than it is in Pandas. For details and code for each operation, see Performance Comparison Test Code.

6.1.1. StaticFrame 0.3.4 v. Pandas 0.23.4

test_class

pd

sf

pd_faster

sf_faster

FrameFloat_H1D_add_series_partial

2.8959

0.6154

4.7059

FrameFloat_H2D_add_series_partial

4.6065

3.1625

1.4566

FrameFloat_apply_axis0

1.8324

0.8498

2.1563

FrameFloat_apply_axis1

10.8848

3.0343

3.5872

FrameFloat_dropna_any_axis0

4.6445

3.6647

1.2674

FrameFloat_dropna_any_axis1

4.2284

0.2998

14.1058

FrameFloat_from_records

1.6269

1.0615

1.5326

FrameFloat_isna

0.1937

0.2523

1.3029

FrameFloat_slice_loc_column

0.1004

0.0731

1.3738

FrameFloat_slice_loc_columns

0.0864

0.0744

1.1616

FrameFloat_slice_loc_index

0.2667

0.143

1.8659

FrameFloat_slice_loc_indices

0.2425

9.0009

37.1208

FrameFloat_sum_skipna_axis0

1.3131

0.7694

1.7066

FrameFloat_sum_skipna_axis1

1.4416

0.6903

2.0885

FrameMixed_from_records

0.9984

1.0093

1.011

FrameMixed_slice_loc_column

0.1009

0.0733

1.3763

FrameMixed_slice_loc_columns

18.3912

0.5906

31.1382

FrameMixed_slice_loc_index

0.5076

1.9941

3.9287

FrameMixed_slice_loc_indices

0.3242

6.878

21.2172

FrameStrFloat_init

0.2942

1.0577

3.5952

IndexHierarchy2d_from_labels

0.4343

1.2591

2.8991

IndexHierarchy2d_from_product

0.1985

0.0284

6.9958

IndexHierarchy3d_from_labels

0.5877

1.6323

2.7773

IndexHierarchy3d_from_product

0.0862

0.0089

9.6377

IndexStr_init

0.1334

0.5931

4.446

SeriesFloatH2DString_loc_slice

0.1185

0.6692

5.6458

SeriesFloatH2DString_loc_target

0.0208

0.0033

6.2216

SeriesFloatH3DString_loc_slice_slice_target

0.4136

7.0483

17.0431

SeriesFloatH3DString_loc_slice_target_slice

2.8101

0.3292

8.5355

SeriesFloatH3DString_loc_target

0.058

0.0046

12.7345

SeriesIntFloat_dropna

0.067

0.1664

2.483

SeriesIntFloat_fillna

0.0375

0.0085

4.3834

SeriesIntFloat_init

0.0081

0.0091

1.1157

SeriesIntFloat_isnull

0.0164

0.0026

6.385

SeriesIntObjStr_dropna

0.1786

0.3344

1.8725

SeriesIntObjStr_fillna

0.1569

0.1247

1.2582

SeriesIntObjStr_isnull

0.0952

0.0988

1.0372

SeriesIntObj_dropna

0.1716

0.3029

1.7657

SeriesIntObj_fillna

0.3919

0.1236

3.1709

SeriesIntObj_isnull

0.0919

0.1014

1.1025

SeriesStrFloat_dropna

0.0674

0.8448

12.5296

SeriesStrFloat_fillna

0.0371

0.0085

4.3628

SeriesStrFloat_isnull

0.0164

0.0026

6.3598

SeriesStrObj_init

0.2408

0.4165

1.7295

6.2. Performance Comparison Test Code

Performance tests are based on the following implementations. Follow the source links to view the relevant code.

class FrameFloat_H1D_add_series_partial[source]

Adding series that only partially match the index

class FrameFloat_H2D_add_series_partial[source]

Adding series that only partially match the index

class FrameFloat_apply_axis0[source]
class FrameFloat_apply_axis1[source]
class FrameFloat_dropna_any_axis0[source]
class FrameFloat_dropna_any_axis1[source]
class FrameFloat_from_records[source]
class FrameFloat_isna[source]
class FrameFloat_slice_loc_column[source]
class FrameFloat_slice_loc_columns[source]
class FrameFloat_slice_loc_index[source]
class FrameFloat_slice_loc_indices[source]
class FrameFloat_sum_skipna_axis0[source]
class FrameFloat_sum_skipna_axis1[source]
class FrameMixed_from_records[source]
class FrameMixed_slice_loc_column[source]
class FrameMixed_slice_loc_columns[source]
class FrameMixed_slice_loc_index[source]
class FrameMixed_slice_loc_indices[source]
class FrameStrFloat_init[source]
class IndexHierarchy2d_from_labels[source]
class IndexHierarchy2d_from_product[source]
class IndexHierarchy3d_from_labels[source]
class IndexHierarchy3d_from_product[source]
class IndexStr_init[source]

Index construction for string labels.

class PerfTest[source]
class SeriesFloatH2DString_loc_slice[source]
class SeriesFloatH2DString_loc_target[source]
class SeriesFloatH3DString_loc_slice_slice_target[source]
class SeriesFloatH3DString_loc_slice_target_slice[source]
class SeriesFloatH3DString_loc_target[source]

Selecting single value from 3-level hierarchy.

class SeriesIntFloat_apply[source]
class SeriesIntFloat_drop_duplicated[source]
class SeriesIntFloat_dropna[source]
class SeriesIntFloat_fillna[source]
class SeriesIntFloat_fillna_forward[source]
class SeriesIntFloat_init[source]
class SeriesIntFloat_isnull[source]
class SeriesIntObjStr_apply[source]
class SeriesIntObjStr_dropna[source]
class SeriesIntObjStr_fillna[source]
class SeriesIntObjStr_fillna_forward[source]
class SeriesIntObjStr_isnull[source]
class SeriesIntObj_apply[source]
class SeriesIntObj_drop_duplicated[source]
class SeriesIntObj_dropna[source]
class SeriesIntObj_fillna[source]
class SeriesIntObj_fillna_forward[source]
class SeriesIntObj_isnull[source]
class SeriesStrFloat_apply[source]
class SeriesStrFloat_dropna[source]
class SeriesStrFloat_fillna[source]
class SeriesStrFloat_fillna_forward[source]
class SeriesStrFloat_isna[source]
class SeriesStrObj_init[source]