Raccoon vs. Pandas speed test

Setup pythonpath, import libraries and initialized DataFrame to store results

index    raccoon    pandas    ratio
-------  ---------  --------  -------
version  2.1.3      0.20.2

Initialize 10,000 empty DataFrames

92.4 ms ± 6.36 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
2.74 s ± 234 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index             raccoon              pandas                 ratio
----------------  -------------------  -----------------  ---------
version           2.1.3                0.20.2
initialize empty  0.08496840788127305  2.486505687206119  0.0341718

Initialize 100 row X 100 col DataFrame()

87.8 µs ± 8.43 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
8.11 ms ± 779 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
index                   raccoon                pandas                    ratio
----------------------  ---------------------  --------------------  ---------
version                 2.1.3                  0.20.2
initialize empty        0.08496840788127305    2.486505687206119     0.0341718
initialize with matrix  8.295801655311905e-05  0.007671599044494002  0.0108137

Add 10,000 items in 1 column to empty DataFrame

43.5 ms ± 402 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
16.2 s ± 1.53 s per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                   raccoon                pandas                     ratio
----------------------  ---------------------  --------------------  ----------
version                 2.1.3                  0.20.2
initialize empty        0.08496840788127305    2.486505687206119     0.0341718
initialize with matrix  8.295801655311905e-05  0.007671599044494002  0.0108137
add rows one column     0.04288183311489533    14.87375424325954     0.00288305

Add 100 rows of 100 columns to empty DataFrame

9.32 ms ± 808 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
184 ms ± 3.55 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                   raccoon                pandas                     ratio
----------------------  ---------------------  --------------------  ----------
version                 2.1.3                  0.20.2
initialize empty        0.08496840788127305    2.486505687206119     0.0341718
initialize with matrix  8.295801655311905e-05  0.007671599044494002  0.0108137
add rows one column     0.04288183311489533    14.87375424325954     0.00288305
add matrix              0.008299982997955908   0.1785839394495099    0.0464766

Append 10x10 DataFrame 1000 times

62.2 ms ± 7.32 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
164 ms ± 5.16 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                   raccoon                pandas                     ratio
----------------------  ---------------------  --------------------  ----------
version                 2.1.3                  0.20.2
initialize empty        0.08496840788127305    2.486505687206119     0.0341718
initialize with matrix  8.295801655311905e-05  0.007671599044494002  0.0108137
add rows one column     0.04288183311489533    14.87375424325954     0.00288305
add matrix              0.008299982997955908   0.1785839394495099    0.0464766
append                  0.05763429718412851    0.15777540076405216   0.365293

Get

528 ms ± 64.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
783 ms ± 74.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                   raccoon                pandas                     ratio
----------------------  ---------------------  --------------------  ----------
version                 2.1.3                  0.20.2
initialize empty        0.08496840788127305    2.486505687206119     0.0341718
initialize with matrix  8.295801655311905e-05  0.007671599044494002  0.0108137
add rows one column     0.04288183311489533    14.87375424325954     0.00288305
add matrix              0.008299982997955908   0.1785839394495099    0.0464766
append                  0.05763429718412851    0.15777540076405216   0.365293
get cell                0.4936867081052583     0.7425185427150893    0.664881
36.6 ms ± 5.38 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
313 µs ± 2.39 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
index                   raccoon                pandas                         ratio
----------------------  ---------------------  ----------------------  ------------
version                 2.1.3                  0.20.2
initialize empty        0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix  8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column     0.04288183311489533    14.87375424325954         0.00288305
add matrix              0.008299982997955908   0.1785839394495099        0.0464766
append                  0.05763429718412851    0.15777540076405216       0.365293
get cell                0.4936867081052583     0.7425185427150893        0.664881
get column all index    0.032696135984224384   0.00030877898993577447  105.888
465 ms ± 51.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
6 s ± 425 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
815 ms ± 73.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
118 ms ± 10.4 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698

Set

436 ms ± 59.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
1 s ± 78.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698
set cell                 0.3987260515496587     0.9623946910782024        0.414306
4.19 ms ± 748 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
12.7 ms ± 1.02 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698
set cell                 0.3987260515496587     0.9623946910782024        0.414306
set column all index     0.00376809479375936    0.011686656340490344      0.322427
269 ms ± 3.72 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
22.7 s ± 244 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698
set cell                 0.3987260515496587     0.9623946910782024        0.414306
set column all index     0.00376809479375936    0.011686656340490344      0.322427
set column subset index  0.26396186901109786    22.454482046778423        0.0117554
56.3 ms ± 8.04 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
500 ms ± 80.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698
set cell                 0.3987260515496587     0.9623946910782024        0.414306
set column all index     0.00376809479375936    0.011686656340490344      0.322427
set column subset index  0.26396186901109786    22.454482046778423        0.0117554
set index all columns    0.05272717698682072    0.4621994576302768        0.114079

Sort

12.4 ms ± 807 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
539 µs ± 62.9 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698
set cell                 0.3987260515496587     0.9623946910782024        0.414306
set column all index     0.00376809479375936    0.011686656340490344      0.322427
set column subset index  0.26396186901109786    22.454482046778423        0.0117554
set index all columns    0.05272717698682072    0.4621994576302768        0.114079
sort index               0.011655945561328736   0.0004977774624292124    23.416

Iterators

24.1 ms ± 532 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
20.3 ms ± 599 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698
set cell                 0.3987260515496587     0.9623946910782024        0.414306
set column all index     0.00376809479375936    0.011686656340490344      0.322427
set column subset index  0.26396186901109786    22.454482046778423        0.0117554
set index all columns    0.05272717698682072    0.4621994576302768        0.114079
sort index               0.011655945561328736   0.0004977774624292124    23.416
iterate rows             0.02340574597695877    0.01948813583071569       1.20103

Insert in the middle

26.4 ms ± 381 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
239 ms ± 2.81 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698
set cell                 0.3987260515496587     0.9623946910782024        0.414306
set column all index     0.00376809479375936    0.011686656340490344      0.322427
set column subset index  0.26396186901109786    22.454482046778423        0.0117554
set index all columns    0.05272717698682072    0.4621994576302768        0.114079
sort index               0.011655945561328736   0.0004977774624292124    23.416
iterate rows             0.02340574597695877    0.01948813583071569       1.20103
insert rows              0.025894068785544278   0.2348415172963314        0.110262

Time Series Append

Simulate the recording of a stock on 1 minute intervals and appending to the DataFrame

114 ms ± 9.01 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
27.2 s ± 4 s per loop (mean ± std. dev. of 7 runs, 1 loop each)
index                    raccoon                pandas                         ratio
-----------------------  ---------------------  ----------------------  ------------
version                  2.1.3                  0.20.2
initialize empty         0.08496840788127305    2.486505687206119         0.0341718
initialize with matrix   8.295801655311905e-05  0.007671599044494002      0.0108137
add rows one column      0.04288183311489533    14.87375424325954         0.00288305
add matrix               0.008299982997955908   0.1785839394495099        0.0464766
append                   0.05763429718412851    0.15777540076405216       0.365293
get cell                 0.4936867081052583     0.7425185427150893        0.664881
get column all index     0.032696135984224384   0.00030877898993577447  105.888
get column subset index  0.42664153398601457    5.714989510943553         0.0746531
get index all columns    0.7787561018819247     0.10775676991503928       7.22698
set cell                 0.3987260515496587     0.9623946910782024        0.414306
set column all index     0.00376809479375936    0.011686656340490344      0.322427
set column subset index  0.26396186901109786    22.454482046778423        0.0117554
set index all columns    0.05272717698682072    0.4621994576302768        0.114079
sort index               0.011655945561328736   0.0004977774624292124    23.416
iterate rows             0.02340574597695877    0.01948813583071569       1.20103
insert rows              0.025894068785544278   0.2348415172963314        0.110262
time series              0.10705897210370949    23.24008671488832         0.00460665