Last active
April 6, 2026 01:08
-
-
Save ffelixg/cb302e606920c88f5450f9fd20758e86 to your computer and use it in GitHub Desktop.
mssql fetch arrow benchmarks
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
| import os | |
| import mssql_python | |
| import polars as pl | |
| import json | |
| import pandas as pd | |
| import pyarrow as pa | |
| connection = mssql_python.connect(os.environ["DB_CONNECTION_STRING"]) | |
| cursor = connection.cursor() | |
| def build_query(expr: str, n_cols: int, n_rows: int) -> str: | |
| columns = ", ".join(f"{expr} AS col_{i}" for i in range(n_cols)) | |
| return f"SELECT {columns} FROM GENERATE_SERIES(1, {n_rows})" | |
| def make_before(desc: str, query: str, result: str): | |
| def bench(): | |
| if result == "polars": | |
| _ = pl.read_database(query=query, connection=cursor) | |
| elif result == "pandas": | |
| _ = pd.read_sql(query, connection) | |
| elif result == "json": | |
| cursor.execute(query) | |
| assert cursor.description | |
| names = [desc[0] for desc in cursor.description] | |
| _ = json.dumps( | |
| [dict(zip(names, row)) for row in cursor.fetchall()], | |
| default=str, | |
| ) | |
| elif result == "native": | |
| _ = cursor.execute(query).fetchall() | |
| elif result == "arrow": | |
| cursor.execute(query) | |
| assert cursor.description | |
| names = [desc[0] for desc in cursor.description] | |
| rows = cursor.fetchall() | |
| columns = list(zip(*rows)) | |
| _ = pa.table({name: column for name, column in zip(names, columns)}) | |
| else: | |
| 1 / 0 | |
| bench.__name__ = f"before_{desc}" | |
| return bench | |
| def make_after(desc: str, query: str, result: str): | |
| def bench(): | |
| arrow_tbl = cursor.execute(query).arrow() | |
| if result == "polars": | |
| _ = pl.DataFrame(arrow_tbl) | |
| elif result == "pandas": | |
| _ = arrow_tbl.to_pandas(types_mapper=pd.ArrowDtype) | |
| elif result == "json": | |
| _ = pl.DataFrame(arrow_tbl).write_json() | |
| elif result in ("native", "arrow"): | |
| pass | |
| else: | |
| 1 / 0 | |
| bench.__name__ = f"after_{desc}" | |
| return bench | |
| __benchmarks__ = [] | |
| cases = [ | |
| ("bigint", "cast(value as bigint)"), | |
| ("int", "cast(value as int)"), | |
| ("int 10pct null", "iif(value % 10 < 1, null, cast(value as int))"), | |
| ("int 20pct null", "iif(value % 10 < 2, null, cast(value as int))"), | |
| ("int 50pct null", "iif(value % 10 < 5, null, cast(value as int))"), | |
| ("int 90pct null", "iif(value % 10 < 9, null, cast(value as int))"), | |
| ("int all null", "cast(null as int)"), | |
| ("bit", "cast(value % 2 as bit)"), | |
| ("float", "cast(1.23 as float)"), | |
| ("decimal", "cast(123.45 as decimal(10,2))"), | |
| ("date", "cast('2024-01-01' as date)"), | |
| ("time_6", "cast('12:34:56.123456' as time(6))"), | |
| ("datetime", "cast('2024-01-01T12:34:56.997' as datetime)"), | |
| ("datetime2_6", "cast('2024-01-01T12:34:56.123456' as datetime2(6))"), | |
| ("smalldatetime", "cast('2024-01-01T12:34:00' as smalldatetime)"), | |
| ("datetimeoffset_6", "cast('2024-01-01T12:34:56.123456+00:00' as datetimeoffset(6))"), | |
| ("uniqueidentifier", "cast('6F9619FF-8B86-D011-B42D-00C04FC964FF' as uniqueidentifier)"), | |
| ("varbinary_4", "cast(0x01020304 as varbinary(4))"), | |
| ("varbinary_100", f"cast(0x{100*'01'} as varbinary(100))"), | |
| ("varbinary_max", f"cast(0x{100*'01'} as varbinary(max))"), | |
| ("varchar_10", "cast('hello' as varchar(10))"), | |
| ("nvarchar_10", "cast(N'hello' as nvarchar(10))"), | |
| ("nvarchar_10_max", "cast(N'hello' as nvarchar(max))"), | |
| ("nvarchar_100", f"cast(N'{100*'a'}' as nvarchar(100))"), | |
| ("nvarchar_100_max", f"cast(N'{100*'a'}' as nvarchar(max))"), | |
| ] | |
| configs = [ | |
| {"n_rows": 100_000, "n_cols": 20, "result": "polars"}, | |
| {"n_rows": 1_000_000, "n_cols": 1, "result": "polars"}, | |
| {"n_rows": 1_000_000, "n_cols": 1, "result": "pandas"}, | |
| {"n_rows": 1_000_000, "n_cols": 1, "result": "json"}, | |
| {"n_rows": 1_000_000, "n_cols": 1, "result": "native"}, | |
| {"n_rows": 1_000_000, "n_cols": 1, "result": "arrow"}, | |
| ] | |
| for desc, expr in cases: | |
| for cfg in configs: | |
| query = build_query(expr, n_cols=cfg["n_cols"], n_rows=cfg["n_rows"]) | |
| if cfg["result"] == "json" and "binary" in desc: | |
| continue # not implemented | |
| if cfg["result"] == "arrow" and "uniqueidentifier" in desc: | |
| continue # not implemented | |
| before_bench = make_before(desc, query, cfg["result"]) | |
| after_bench = make_after(desc, query, cfg["result"]) | |
| title = f"{cfg['n_cols']}x {desc} to {cfg['result'].rjust(7)}" | |
| __benchmarks__.append((before_bench, after_bench, title)) |
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
| Benchmarks, repeat=10, number=1 | |
| ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓ | |
| ┃ Benchmark ┃ Min ┃ Max ┃ Mean ┃ Min (+) ┃ Max (+) ┃ Mean (+) ┃ | |
| ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ | |
| │ 20x bigint to polars │ 0.269 │ 0.314 │ 0.286 │ 0.158 (1.7x) │ 0.182 (1.7x) │ 0.162 (1.8x) │ | |
| │ 1x bigint to polars │ 0.447 │ 0.552 │ 0.475 │ 0.120 (3.7x) │ 0.143 (3.9x) │ 0.123 (3.9x) │ | |
| │ 1x bigint to pandas │ 0.485 │ 0.524 │ 0.508 │ 0.121 (4.0x) │ 0.133 (3.9x) │ 0.122 (4.2x) │ | |
| │ 1x bigint to json │ 0.591 │ 0.637 │ 0.619 │ 0.138 (4.3x) │ 0.193 (3.3x) │ 0.158 (3.9x) │ | |
| │ 1x bigint to native │ 0.311 │ 0.366 │ 0.333 │ 0.121 (2.6x) │ 0.145 (2.5x) │ 0.124 (2.7x) │ | |
| │ 1x bigint to arrow │ 0.390 │ 0.422 │ 0.408 │ 0.120 (3.3x) │ 0.144 (2.9x) │ 0.123 (3.3x) │ | |
| │ 20x int to polars │ 0.204 │ 0.257 │ 0.226 │ 0.111 (1.8x) │ 0.143 (1.8x) │ 0.115 (2.0x) │ | |
| │ 1x int to polars │ 0.412 │ 0.456 │ 0.427 │ 0.095 (4.3x) │ 0.121 (3.8x) │ 0.098 (4.3x) │ | |
| │ 1x int to pandas │ 0.455 │ 0.502 │ 0.479 │ 0.095 (4.8x) │ 0.119 (4.2x) │ 0.098 (4.9x) │ | |
| │ 1x int to json │ 0.566 │ 0.630 │ 0.589 │ 0.114 (5.0x) │ 0.137 (4.6x) │ 0.117 (5.0x) │ | |
| │ 1x int to native │ 0.286 │ 0.329 │ 0.304 │ 0.094 (3.0x) │ 0.119 (2.8x) │ 0.097 (3.1x) │ | |
| │ 1x int to arrow │ 0.375 │ 0.423 │ 0.396 │ 0.095 (3.9x) │ 0.120 (3.5x) │ 0.108 (3.7x) │ | |
| │ 20x int 10pct null to polars │ 0.227 │ 0.287 │ 0.258 │ 0.121 (1.9x) │ 0.150 (1.9x) │ 0.124 (2.1x) │ | |
| │ 1x int 10pct null to polars │ 0.442 │ 0.469 │ 0.456 │ 0.118 (3.7x) │ 0.123 (3.8x) │ 0.119 (3.8x) │ | |
| │ 1x int 10pct null to pandas │ 0.457 │ 0.504 │ 0.479 │ 0.118 (3.9x) │ 0.205 (2.5x) │ 0.129 (3.7x) │ | |
| │ 1x int 10pct null to json │ 0.595 │ 0.650 │ 0.617 │ 0.138 (4.3x) │ 0.163 (4.0x) │ 0.141 (4.4x) │ | |
| │ 1x int 10pct null to native │ 0.310 │ 0.358 │ 0.328 │ 0.116 (2.7x) │ 0.140 (2.6x) │ 0.119 (2.8x) │ | |
| │ 1x int 10pct null to arrow │ 0.386 │ 0.417 │ 0.404 │ 0.116 (3.3x) │ 0.162 (2.6x) │ 0.131 (3.1x) │ | |
| │ 20x int 20pct null to polars │ 0.229 │ 0.264 │ 0.249 │ 0.113 (2.0x) │ 0.114 (2.3x) │ 0.113 (2.2x) │ | |
| │ 1x int 20pct null to polars │ 0.440 │ 0.471 │ 0.463 │ 0.118 (3.7x) │ 0.119 (3.9x) │ 0.118 (3.9x) │ | |
| │ 1x int 20pct null to pandas │ 0.454 │ 0.496 │ 0.477 │ 0.116 (3.9x) │ 0.137 (3.6x) │ 0.120 (4.0x) │ | |
| │ 1x int 20pct null to json │ 0.587 │ 0.632 │ 0.608 │ 0.137 (4.3x) │ 0.188 (3.4x) │ 0.154 (4.0x) │ | |
| │ 1x int 20pct null to native │ 0.308 │ 0.385 │ 0.332 │ 0.116 (2.7x) │ 0.131 (2.9x) │ 0.118 (2.8x) │ | |
| │ 1x int 20pct null to arrow │ 0.390 │ 0.419 │ 0.406 │ 0.116 (3.4x) │ 0.137 (3.1x) │ 0.127 (3.2x) │ | |
| │ 20x int 50pct null to polars │ 0.216 │ 0.249 │ 0.233 │ 0.100 (2.2x) │ 0.112 (2.2x) │ 0.106 (2.2x) │ | |
| │ 1x int 50pct null to polars │ 0.425 │ 0.512 │ 0.456 │ 0.109 (3.9x) │ 0.131 (3.9x) │ 0.114 (4.0x) │ | |
| │ 1x int 50pct null to pandas │ 0.435 │ 0.463 │ 0.451 │ 0.107 (4.1x) │ 0.129 (3.6x) │ 0.109 (4.1x) │ | |
| │ 1x int 50pct null to json │ 0.580 │ 0.686 │ 0.603 │ 0.128 (4.5x) │ 0.167 (4.1x) │ 0.143 (4.2x) │ | |
| │ 1x int 50pct null to native │ 0.298 │ 0.337 │ 0.320 │ 0.107 (2.8x) │ 0.173 (2.0x) │ 0.114 (2.8x) │ | |
| │ 1x int 50pct null to arrow │ 0.370 │ 0.403 │ 0.385 │ 0.106 (3.5x) │ 0.128 (3.2x) │ 0.110 (3.5x) │ | |
| │ 20x int 90pct null to polars │ 0.157 │ 0.188 │ 0.172 │ 0.090 (1.7x) │ 0.099 (1.9x) │ 0.092 (1.9x) │ | |
| │ 1x int 90pct null to polars │ 0.408 │ 0.441 │ 0.425 │ 0.101 (4.0x) │ 0.102 (4.3x) │ 0.102 (4.2x) │ | |
| │ 1x int 90pct null to pandas │ 0.404 │ 0.448 │ 0.426 │ 0.101 (4.0x) │ 0.111 (4.0x) │ 0.104 (4.1x) │ | |
| │ 1x int 90pct null to json │ 0.551 │ 0.581 │ 0.569 │ 0.118 (4.7x) │ 0.147 (4.0x) │ 0.121 (4.7x) │ | |
| │ 1x int 90pct null to native │ 0.285 │ 0.315 │ 0.305 │ 0.110 (2.6x) │ 0.115 (2.7x) │ 0.111 (2.8x) │ | |
| │ 1x int 90pct null to arrow │ 0.354 │ 0.438 │ 0.383 │ 0.101 (3.5x) │ 0.135 (3.3x) │ 0.112 (3.4x) │ | |
| │ 20x int all null to polars │ 0.127 │ 0.135 │ 0.132 │ 0.086 (1.5x) │ 0.088 (1.5x) │ 0.087 (1.5x) │ | |
| │ 1x int all null to polars │ 0.382 │ 0.402 │ 0.394 │ 0.074 (5.1x) │ 0.096 (4.2x) │ 0.077 (5.1x) │ | |
| │ 1x int all null to pandas │ 0.367 │ 0.440 │ 0.392 │ 0.074 (5.0x) │ 0.096 (4.6x) │ 0.077 (5.1x) │ | |
| │ 1x int all null to json │ 0.513 │ 0.572 │ 0.530 │ 0.091 (5.6x) │ 0.114 (5.0x) │ 0.094 (5.6x) │ | |
| │ 1x int all null to native │ 0.252 │ 0.318 │ 0.277 │ 0.074 (3.4x) │ 0.097 (3.3x) │ 0.077 (3.6x) │ | |
| │ 1x int all null to arrow │ 0.317 │ 0.347 │ 0.339 │ 0.074 (4.3x) │ 0.076 (4.6x) │ 0.074 (4.6x) │ | |
| │ 20x bit to polars │ 0.174 │ 0.200 │ 0.187 │ 0.112 (1.6x) │ 0.116 (1.7x) │ 0.113 (1.7x) │ | |
| │ 1x bit to polars │ 0.396 │ 0.432 │ 0.420 │ 0.096 (4.1x) │ 0.121 (3.6x) │ 0.099 (4.2x) │ | |
| │ 1x bit to pandas │ 0.393 │ 0.427 │ 0.409 │ 0.097 (4.1x) │ 0.125 (3.4x) │ 0.107 (3.8x) │ | |
| │ 1x bit to json │ 0.554 │ 0.610 │ 0.572 │ 0.112 (4.9x) │ 0.137 (4.4x) │ 0.117 (4.9x) │ | |
| │ 1x bit to native │ 0.279 │ 0.362 │ 0.306 │ 0.107 (2.6x) │ 0.132 (2.7x) │ 0.109 (2.8x) │ | |
| │ 1x bit to arrow │ 0.345 │ 0.383 │ 0.363 │ 0.095 (3.6x) │ 0.117 (3.3x) │ 0.098 (3.7x) │ | |
| │ 20x float to polars │ 0.275 │ 0.296 │ 0.286 │ 0.158 (1.7x) │ 0.174 (1.7x) │ 0.161 (1.8x) │ | |
| │ 1x float to polars │ 0.427 │ 0.454 │ 0.442 │ 0.113 (3.8x) │ 0.149 (3.0x) │ 0.117 (3.8x) │ | |
| │ 1x float to pandas │ 0.427 │ 0.464 │ 0.446 │ 0.112 (3.8x) │ 0.186 (2.5x) │ 0.137 (3.3x) │ | |
| │ 1x float to json │ 0.636 │ 0.667 │ 0.656 │ 0.150 (4.3x) │ 0.179 (3.7x) │ 0.159 (4.1x) │ | |
| │ 1x float to native │ 0.298 │ 0.358 │ 0.320 │ 0.109 (2.7x) │ 0.136 (2.6x) │ 0.128 (2.5x) │ | |
| │ 1x float to arrow │ 0.402 │ 0.455 │ 0.415 │ 0.109 (3.7x) │ 0.132 (3.4x) │ 0.111 (3.7x) │ | |
| │ 20x decimal to polars │ 1.359 │ 1.396 │ 1.377 │ 0.378 (3.6x) │ 0.386 (3.6x) │ 0.382 (3.6x) │ | |
| │ 1x decimal to polars │ 0.978 │ 0.994 │ 0.984 │ 0.220 (4.4x) │ 0.241 (4.1x) │ 0.227 (4.3x) │ | |
| │ 1x decimal to pandas │ 0.855 │ 0.878 │ 0.866 │ 0.218 (3.9x) │ 0.228 (3.8x) │ 0.223 (3.9x) │ | |
| │ 1x decimal to json │ 0.912 │ 0.948 │ 0.924 │ 0.246 (3.7x) │ 0.264 (3.6x) │ 0.253 (3.6x) │ | |
| │ 1x decimal to native │ 0.549 │ 0.559 │ 0.554 │ 0.218 (2.5x) │ 0.239 (2.3x) │ 0.227 (2.4x) │ | |
| │ 1x decimal to arrow │ 1.098 │ 1.130 │ 1.112 │ 0.218 (5.0x) │ 0.230 (4.9x) │ 0.223 (5.0x) │ | |
| │ 20x date to polars │ 0.707 │ 0.717 │ 0.710 │ 0.177 (4.0x) │ 0.187 (3.8x) │ 0.179 (4.0x) │ | |
| │ 1x date to polars │ 0.651 │ 0.662 │ 0.656 │ 0.118 (5.5x) │ 0.136 (4.9x) │ 0.121 (5.4x) │ | |
| │ 1x date to pandas │ 0.606 │ 0.631 │ 0.616 │ 0.118 (5.1x) │ 0.198 (3.2x) │ 0.126 (4.9x) │ | |
| │ 1x date to json │ 1.002 │ 1.031 │ 1.010 │ 0.166 (6.0x) │ 0.194 (5.3x) │ 0.172 (5.9x) │ | |
| │ 1x date to native │ 0.492 │ 0.507 │ 0.497 │ 0.117 (4.2x) │ 0.134 (3.8x) │ 0.120 (4.1x) │ | |
| │ 1x date to arrow │ 0.567 │ 0.598 │ 0.573 │ 0.117 (4.8x) │ 0.174 (3.4x) │ 0.124 (4.6x) │ | |
| │ 20x time_6 to polars │ 0.796 │ 0.822 │ 0.811 │ 0.268 (3.0x) │ 0.281 (2.9x) │ 0.272 (3.0x) │ | |
| │ 1x time_6 to polars │ 0.698 │ 0.744 │ 0.706 │ 0.169 (4.1x) │ 0.176 (4.2x) │ 0.171 (4.1x) │ | |
| │ 1x time_6 to pandas │ 0.653 │ 0.667 │ 0.659 │ 0.168 (3.9x) │ 0.180 (3.7x) │ 0.171 (3.9x) │ | |
| │ 1x time_6 to json │ 1.046 │ 1.064 │ 1.054 │ 0.213 (4.9x) │ 0.235 (4.5x) │ 0.223 (4.7x) │ | |
| │ 1x time_6 to native │ 0.532 │ 0.545 │ 0.536 │ 0.167 (3.2x) │ 0.169 (3.2x) │ 0.168 (3.2x) │ | |
| │ 1x time_6 to arrow │ 0.611 │ 0.624 │ 0.618 │ 0.168 (3.6x) │ 0.183 (3.4x) │ 0.170 (3.6x) │ | |
| │ 20x datetime to polars │ 1.470 │ 1.488 │ 1.481 │ 0.159 (9.3x) │ 0.176 (8.5x) │ 0.163 (9.1x) │ | |
| │ 1x datetime to polars │ 1.042 │ 1.058 │ 1.049 │ 0.110 (9.5x) │ 0.136 (7.8x) │ 0.113 (9.2x) │ | |
| │ 1x datetime to pandas │ 1.084 │ 1.107 │ 1.096 │ 0.109 (9.9x) │ 0.247 (4.5x) │ 0.124 (8.9x) │ | |
| │ 1x datetime to json │ 1.556 │ 1.585 │ 1.568 │ 0.197 (7.9x) │ 0.294 (5.4x) │ 0.229 (6.9x) │ | |
| │ 1x datetime to native │ 0.819 │ 0.835 │ 0.825 │ 0.112 (7.3x) │ 0.140 (5.9x) │ 0.115 (7.2x) │ | |
| │ 1x datetime to arrow │ 0.948 │ 0.961 │ 0.951 │ 0.111 (8.5x) │ 0.126 (7.6x) │ 0.116 (8.2x) │ | |
| │ 20x datetime2_6 to polars │ 1.517 │ 1.541 │ 1.533 │ 0.190 (8.0x) │ 0.209 (7.4x) │ 0.194 (7.9x) │ | |
| │ 1x datetime2_6 to polars │ 1.069 │ 1.076 │ 1.072 │ 0.124 (8.6x) │ 0.155 (6.9x) │ 0.128 (8.4x) │ | |
| │ 1x datetime2_6 to pandas │ 1.115 │ 1.135 │ 1.120 │ 0.123 (9.1x) │ 0.145 (7.8x) │ 0.130 (8.6x) │ | |
| │ 1x datetime2_6 to json │ 1.582 │ 1.603 │ 1.593 │ 0.210 (7.5x) │ 0.242 (6.6x) │ 0.226 (7.0x) │ | |
| │ 1x datetime2_6 to native │ 0.841 │ 0.853 │ 0.847 │ 0.123 (6.8x) │ 0.146 (5.9x) │ 0.126 (6.7x) │ | |
| │ 1x datetime2_6 to arrow │ 0.975 │ 0.988 │ 0.984 │ 0.123 (7.9x) │ 0.144 (6.9x) │ 0.126 (7.8x) │ | |
| │ 20x smalldatetime to polars │ 1.447 │ 1.470 │ 1.456 │ 0.152 (9.5x) │ 0.164 (9.0x) │ 0.155 (9.4x) │ | |
| │ 1x smalldatetime to polars │ 1.030 │ 1.041 │ 1.034 │ 0.105 (9.8x) │ 0.129 (8.1x) │ 0.108 (9.6x) │ | |
| │ 1x smalldatetime to pandas │ 1.084 │ 1.099 │ 1.090 │ 0.105 (10.3x) │ 0.126 (8.8x) │ 0.108 (10.1x) │ | |
| │ 1x smalldatetime to json │ 1.506 │ 1.517 │ 1.511 │ 0.182 (8.3x) │ 0.211 (7.2x) │ 0.193 (7.8x) │ | |
| │ 1x smalldatetime to native │ 0.811 │ 0.822 │ 0.817 │ 0.104 (7.8x) │ 0.124 (6.6x) │ 0.108 (7.5x) │ | |
| │ 1x smalldatetime to arrow │ 0.948 │ 0.976 │ 0.956 │ 0.105 (9.1x) │ 0.128 (7.6x) │ 0.108 (8.9x) │ | |
| │ 20x datetimeoffset_6 to polars │ 5.736 │ 5.807 │ 5.765 │ 0.221 (26.0x) │ 0.227 (25.6x) │ 0.225 (25.6x) │ | |
| │ 1x datetimeoffset_6 to polars │ 3.166 │ 3.201 │ 3.186 │ 0.140 (22.5x) │ 0.163 (19.7x) │ 0.144 (22.1x) │ | |
| │ 1x datetimeoffset_6 to pandas │ 2.713 │ 2.739 │ 2.725 │ 0.141 (19.3x) │ 0.162 (17.0x) │ 0.144 (18.9x) │ | |
| │ 1x datetimeoffset_6 to json │ 3.510 │ 3.538 │ 3.521 │ 0.210 (16.7x) │ 0.236 (15.0x) │ 0.228 (15.5x) │ | |
| │ 1x datetimeoffset_6 to native │ 2.497 │ 2.542 │ 2.519 │ 0.140 (17.8x) │ 0.165 (15.4x) │ 0.144 (17.5x) │ | |
| │ 1x datetimeoffset_6 to arrow │ 2.701 │ 2.727 │ 2.711 │ 0.141 (19.2x) │ 0.170 (16.0x) │ 0.146 (18.6x) │ | |
| │ 20x uniqueidentifier to polars │ 3.078 │ 3.360 │ 3.297 │ 0.677 (4.5x) │ 0.697 (4.8x) │ 0.685 (4.8x) │ | |
| │ 1x uniqueidentifier to polars │ 2.108 │ 2.152 │ 2.130 │ 0.366 (5.8x) │ 0.386 (5.6x) │ 0.374 (5.7x) │ | |
| │ 1x uniqueidentifier to pandas │ 1.738 │ 1.767 │ 1.748 │ 0.358 (4.9x) │ 0.366 (4.8x) │ 0.362 (4.8x) │ | |
| │ 1x uniqueidentifier to json │ 2.217 │ 2.253 │ 2.234 │ 0.406 (5.5x) │ 0.415 (5.4x) │ 0.409 (5.5x) │ | |
| │ 1x uniqueidentifier to native │ 1.451 │ 1.557 │ 1.495 │ 0.359 (4.0x) │ 0.386 (4.0x) │ 0.366 (4.1x) │ | |
| │ 20x varbinary_4 to polars │ 0.382 │ 0.471 │ 0.403 │ 0.199 (1.9x) │ 0.208 (2.3x) │ 0.203 (2.0x) │ | |
| │ 1x varbinary_4 to polars │ 0.496 │ 0.530 │ 0.512 │ 0.121 (4.1x) │ 0.152 (3.5x) │ 0.126 (4.1x) │ | |
| │ 1x varbinary_4 to pandas │ 0.408 │ 0.442 │ 0.424 │ 0.116 (3.5x) │ 0.136 (3.3x) │ 0.119 (3.6x) │ | |
| │ 1x varbinary_4 to native │ 0.283 │ 0.377 │ 0.310 │ 0.116 (2.4x) │ 0.134 (2.8x) │ 0.119 (2.6x) │ | |
| │ 1x varbinary_4 to arrow │ 0.367 │ 0.446 │ 0.394 │ 0.116 (3.2x) │ 0.136 (3.3x) │ 0.119 (3.3x) │ | |
| │ 20x varbinary_100 to polars │ 3.202 │ 3.236 │ 3.213 │ 1.773 (1.8x) │ 1.796 (1.8x) │ 1.778 (1.8x) │ | |
| │ 1x varbinary_100 to polars │ 1.895 │ 1.981 │ 1.913 │ 0.895 (2.1x) │ 0.907 (2.2x) │ 0.898 (2.1x) │ | |
| │ 1x varbinary_100 to pandas │ 1.245 │ 1.275 │ 1.259 │ 0.889 (1.4x) │ 0.897 (1.4x) │ 0.890 (1.4x) │ | |
| │ 1x varbinary_100 to native │ 1.089 │ 1.113 │ 1.100 │ 0.889 (1.2x) │ 0.889 (1.3x) │ 0.889 (1.2x) │ | |
| │ 1x varbinary_100 to arrow │ 1.216 │ 1.263 │ 1.233 │ 0.889 (1.4x) │ 0.889 (1.4x) │ 0.889 (1.4x) │ | |
| │ 20x varbinary_max to polars │ 3.450 │ 3.524 │ 3.470 │ 2.016 (1.7x) │ 2.027 (1.7x) │ 2.018 (1.7x) │ | |
| │ 1x varbinary_max to polars │ 2.020 │ 2.060 │ 2.035 │ 1.017 (2.0x) │ 1.124 (1.8x) │ 1.038 (2.0x) │ | |
| │ 1x varbinary_max to pandas │ 1.384 │ 1.432 │ 1.398 │ 1.010 (1.4x) │ 1.022 (1.4x) │ 1.012 (1.4x) │ | |
| │ 1x varbinary_max to native │ 1.217 │ 1.264 │ 1.230 │ 1.010 (1.2x) │ 1.021 (1.2x) │ 1.011 (1.2x) │ | |
| │ 1x varbinary_max to arrow │ 1.327 │ 1.345 │ 1.337 │ 1.010 (1.3x) │ 1.020 (1.3x) │ 1.011 (1.3x) │ | |
| │ 20x varchar_10 to polars │ 0.317 │ 0.344 │ 0.333 │ 0.225 (1.4x) │ 0.237 (1.4x) │ 0.232 (1.4x) │ | |
| │ 1x varchar_10 to polars │ 0.451 │ 0.493 │ 0.465 │ 0.142 (3.2x) │ 0.145 (3.4x) │ 0.143 (3.2x) │ | |
| │ 1x varchar_10 to pandas │ 0.418 │ 0.463 │ 0.438 │ 0.136 (3.1x) │ 0.155 (3.0x) │ 0.140 (3.1x) │ | |
| │ 1x varchar_10 to json │ 0.580 │ 0.622 │ 0.601 │ 0.168 (3.4x) │ 0.178 (3.5x) │ 0.173 (3.5x) │ | |
| │ 1x varchar_10 to native │ 0.296 │ 0.326 │ 0.311 │ 0.137 (2.2x) │ 0.142 (2.3x) │ 0.138 (2.3x) │ | |
| │ 1x varchar_10 to arrow │ 0.385 │ 0.426 │ 0.406 │ 0.137 (2.8x) │ 0.155 (2.8x) │ 0.140 (2.9x) │ | |
| │ 20x nvarchar_10 to polars │ 0.382 │ 0.430 │ 0.411 │ 1.137 (-3.0x) │ 1.153 (-2.7x) │ 1.144 (-2.8x) │ | |
| │ 1x nvarchar_10 to polars │ 0.456 │ 0.486 │ 0.473 │ 0.592 (-1.3x) │ 0.607 (-1.2x) │ 0.599 (-1.3x) │ | |
| │ 1x nvarchar_10 to pandas │ 0.427 │ 0.472 │ 0.452 │ 0.581 (-1.4x) │ 0.599 (-1.3x) │ 0.588 (-1.3x) │ | |
| │ 1x nvarchar_10 to json │ 0.594 │ 0.622 │ 0.609 │ 0.614 (-1.0x) │ 0.636 (-1.0x) │ 0.625 (-1.0x) │ | |
| │ 1x nvarchar_10 to native │ 0.299 │ 0.382 │ 0.334 │ 0.583 (-2.0x) │ 0.598 (-1.6x) │ 0.591 (-1.8x) │ | |
| │ 1x nvarchar_10 to arrow │ 0.391 │ 0.449 │ 0.415 │ 0.582 (-1.5x) │ 0.604 (-1.3x) │ 0.595 (-1.4x) │ | |
| │ 20x nvarchar_10_max to polars │ 2.474 │ 2.605 │ 2.509 │ 1.328 (1.9x) │ 1.338 (1.9x) │ 1.332 (1.9x) │ | |
| │ 1x nvarchar_10_max to polars │ 1.614 │ 1.647 │ 1.628 │ 0.754 (2.1x) │ 0.767 (2.1x) │ 0.763 (2.1x) │ | |
| │ 1x nvarchar_10_max to pandas │ 1.579 │ 1.617 │ 1.591 │ 0.753 (2.1x) │ 0.767 (2.1x) │ 0.760 (2.1x) │ | |
| │ 1x nvarchar_10_max to json │ 1.737 │ 1.781 │ 1.762 │ 0.777 (2.2x) │ 0.788 (2.3x) │ 0.782 (2.3x) │ | |
| │ 1x nvarchar_10_max to native │ 1.458 │ 1.492 │ 1.472 │ 0.753 (1.9x) │ 0.768 (1.9x) │ 0.757 (1.9x) │ | |
| │ 1x nvarchar_10_max to arrow │ 1.546 │ 1.576 │ 1.561 │ 0.748 (2.1x) │ 0.766 (2.1x) │ 0.756 (2.1x) │ | |
| │ 20x nvarchar_100 to polars │ 3.766 │ 3.817 │ 3.782 │ 8.470 (-2.2x) │ 8.539 (-2.2x) │ 8.499 (-2.2x) │ | |
| │ 1x nvarchar_100 to polars │ 2.171 │ 2.305 │ 2.196 │ 4.260 (-2.0x) │ 4.302 (-1.9x) │ 4.278 (-1.9x) │ | |
| │ 1x nvarchar_100 to pandas │ 2.114 │ 2.180 │ 2.130 │ 4.254 (-2.0x) │ 4.292 (-2.0x) │ 4.277 (-2.0x) │ | |
| │ 1x nvarchar_100 to json │ 2.385 │ 2.530 │ 2.414 │ 4.354 (-1.8x) │ 4.400 (-1.7x) │ 4.380 (-1.8x) │ | |
| │ 1x nvarchar_100 to native │ 1.955 │ 2.008 │ 1.965 │ 4.256 (-2.2x) │ 4.286 (-2.1x) │ 4.270 (-2.2x) │ | |
| │ 1x nvarchar_100 to arrow │ 2.070 │ 2.111 │ 2.085 │ 4.254 (-2.1x) │ 4.287 (-2.0x) │ 4.274 (-2.0x) │ | |
| │ 20x nvarchar_100_max to polars │ 10.015 │ 10.178 │ 10.114 │ 8.589 (1.2x) │ 8.646 (1.2x) │ 8.624 (1.2x) │ | |
| │ 1x nvarchar_100_max to polars │ 5.416 │ 5.614 │ 5.482 │ 4.423 (1.2x) │ 4.462 (1.3x) │ 4.435 (1.2x) │ | |
| │ 1x nvarchar_100_max to pandas │ 5.354 │ 5.406 │ 5.381 │ 4.373 (1.2x) │ 4.462 (1.2x) │ 4.419 (1.2x) │ | |
| │ 1x nvarchar_100_max to json │ 5.622 │ 5.736 │ 5.660 │ 4.451 (1.3x) │ 4.482 (1.3x) │ 4.464 (1.3x) │ | |
| │ 1x nvarchar_100_max to native │ 5.173 │ 5.229 │ 5.192 │ 4.368 (1.2x) │ 4.398 (1.2x) │ 4.384 (1.2x) │ | |
| │ 1x nvarchar_100_max to arrow │ 5.272 │ 5.316 │ 5.293 │ 4.361 (1.2x) │ 4.402 (1.2x) │ 4.380 (1.2x) │ | |
| └─────────────────────────────────┴─────────┴─────────┴─────────┴─────────────────┴─────────────────┴─────────────────┘ |
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
| Benchmarks, repeat=3, number=1 | |
| ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓ | |
| ┃ Benchmark ┃ Min ┃ Max ┃ Mean ┃ Min (+) ┃ Max (+) ┃ Mean (+) ┃ | |
| ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ | |
| │ 20x bigint to polars │ 0.287 │ 0.298 │ 0.291 │ 0.159 (1.8x) │ 0.161 (1.8x) │ 0.159 (1.8x) │ | |
| │ 1x bigint to polars │ 0.578 │ 0.598 │ 0.587 │ 0.119 (4.8x) │ 0.126 (4.8x) │ 0.122 (4.8x) │ | |
| │ 1x bigint to pandas │ 0.615 │ 0.648 │ 0.636 │ 0.125 (4.9x) │ 0.146 (4.5x) │ 0.133 (4.8x) │ | |
| │ 1x bigint to json │ 0.753 │ 0.762 │ 0.757 │ 0.148 (5.1x) │ 0.171 (4.5x) │ 0.156 (4.8x) │ | |
| │ 1x bigint to native │ 0.386 │ 0.400 │ 0.391 │ 0.120 (3.2x) │ 0.155 (2.6x) │ 0.133 (2.9x) │ | |
| │ 1x bigint to arrow │ 0.480 │ 0.523 │ 0.503 │ 0.124 (3.9x) │ 0.150 (3.5x) │ 0.133 (3.8x) │ | |
| │ 20x int to polars │ 0.225 │ 0.247 │ 0.237 │ 0.096 (2.3x) │ 0.127 (1.9x) │ 0.107 (2.2x) │ | |
| │ 1x int to polars │ 0.530 │ 0.564 │ 0.547 │ 0.098 (5.4x) │ 0.099 (5.7x) │ 0.098 (5.6x) │ | |
| │ 1x int to pandas │ 0.591 │ 0.613 │ 0.599 │ 0.098 (6.0x) │ 0.128 (4.8x) │ 0.111 (5.4x) │ | |
| │ 1x int to json │ 0.698 │ 0.736 │ 0.717 │ 0.119 (5.9x) │ 0.140 (5.3x) │ 0.127 (5.6x) │ | |
| │ 1x int to native │ 0.349 │ 0.396 │ 0.372 │ 0.103 (3.4x) │ 0.136 (2.9x) │ 0.114 (3.3x) │ | |
| │ 1x int to arrow │ 0.461 │ 0.493 │ 0.477 │ 0.097 (4.7x) │ 0.120 (4.1x) │ 0.107 (4.4x) │ | |
| │ 20x int 10pct null to polars │ 0.246 │ 0.279 │ 0.263 │ 0.127 (1.9x) │ 0.182 (1.5x) │ 0.153 (1.7x) │ | |
| │ 1x int 10pct null to polars │ 0.550 │ 0.567 │ 0.561 │ 0.122 (4.5x) │ 0.126 (4.5x) │ 0.124 (4.5x) │ | |
| │ 1x int 10pct null to pandas │ 0.569 │ 0.591 │ 0.583 │ 0.121 (4.7x) │ 0.146 (4.1x) │ 0.129 (4.5x) │ | |
| │ 1x int 10pct null to json │ 0.734 │ 0.740 │ 0.736 │ 0.143 (5.1x) │ 0.170 (4.4x) │ 0.158 (4.6x) │ | |
| │ 1x int 10pct null to native │ 0.384 │ 0.399 │ 0.393 │ 0.119 (3.2x) │ 0.142 (2.8x) │ 0.127 (3.1x) │ | |
| │ 1x int 10pct null to arrow │ 0.467 │ 0.502 │ 0.485 │ 0.120 (3.9x) │ 0.146 (3.4x) │ 0.128 (3.8x) │ | |
| │ 20x int 20pct null to polars │ 0.240 │ 0.260 │ 0.253 │ 0.121 (2.0x) │ 0.133 (2.0x) │ 0.125 (2.0x) │ | |
| │ 1x int 20pct null to polars │ 0.542 │ 0.565 │ 0.556 │ 0.136 (4.0x) │ 0.142 (4.0x) │ 0.138 (4.0x) │ | |
| │ 1x int 20pct null to pandas │ 0.566 │ 0.587 │ 0.579 │ 0.136 (4.2x) │ 0.165 (3.6x) │ 0.146 (4.0x) │ | |
| │ 1x int 20pct null to json │ 0.721 │ 0.735 │ 0.727 │ 0.139 (5.2x) │ 0.166 (4.4x) │ 0.149 (4.9x) │ | |
| │ 1x int 20pct null to native │ 0.377 │ 0.382 │ 0.379 │ 0.116 (3.2x) │ 0.142 (2.7x) │ 0.125 (3.0x) │ | |
| │ 1x int 20pct null to arrow │ 0.467 │ 0.502 │ 0.482 │ 0.115 (4.1x) │ 0.136 (3.7x) │ 0.122 (3.9x) │ | |
| │ 20x int 50pct null to polars │ 0.193 │ 0.228 │ 0.213 │ 0.092 (2.1x) │ 0.122 (1.9x) │ 0.102 (2.1x) │ | |
| │ 1x int 50pct null to polars │ 0.521 │ 0.576 │ 0.541 │ 0.124 (4.2x) │ 0.214 (2.7x) │ 0.154 (3.5x) │ | |
| │ 1x int 50pct null to pandas │ 0.542 │ 0.563 │ 0.555 │ 0.108 (5.0x) │ 0.123 (4.6x) │ 0.113 (4.9x) │ | |
| │ 1x int 50pct null to json │ 0.695 │ 0.732 │ 0.714 │ 0.130 (5.4x) │ 0.151 (4.8x) │ 0.137 (5.2x) │ | |
| │ 1x int 50pct null to native │ 0.362 │ 0.387 │ 0.378 │ 0.107 (3.4x) │ 0.132 (2.9x) │ 0.115 (3.3x) │ | |
| │ 1x int 50pct null to arrow │ 0.453 │ 0.482 │ 0.471 │ 0.108 (4.2x) │ 0.135 (3.6x) │ 0.117 (4.0x) │ | |
| │ 20x int 90pct null to polars │ 0.155 │ 0.173 │ 0.163 │ 0.063 (2.4x) │ 0.089 (1.9x) │ 0.072 (2.3x) │ | |
| │ 1x int 90pct null to polars │ 0.504 │ 0.541 │ 0.525 │ 0.105 (4.8x) │ 0.107 (5.1x) │ 0.106 (5.0x) │ | |
| │ 1x int 90pct null to pandas │ 0.500 │ 0.521 │ 0.510 │ 0.096 (5.2x) │ 0.118 (4.4x) │ 0.103 (4.9x) │ | |
| │ 1x int 90pct null to json │ 0.660 │ 0.678 │ 0.672 │ 0.116 (5.7x) │ 0.143 (4.7x) │ 0.125 (5.4x) │ | |
| │ 1x int 90pct null to native │ 0.334 │ 0.366 │ 0.351 │ 0.095 (3.5x) │ 0.096 (3.8x) │ 0.096 (3.7x) │ | |
| │ 1x int 90pct null to arrow │ 0.424 │ 0.446 │ 0.435 │ 0.095 (4.4x) │ 0.121 (3.7x) │ 0.104 (4.2x) │ | |
| │ 20x int all null to polars │ 0.123 │ 0.134 │ 0.129 │ 0.037 (3.3x) │ 0.038 (3.5x) │ 0.038 (3.4x) │ | |
| │ 1x int all null to polars │ 0.482 │ 0.502 │ 0.489 │ 0.068 (7.1x) │ 0.094 (5.3x) │ 0.077 (6.4x) │ | |
| │ 1x int all null to pandas │ 0.473 │ 0.478 │ 0.475 │ 0.070 (6.8x) │ 0.104 (4.6x) │ 0.083 (5.7x) │ | |
| │ 1x int all null to json │ 0.635 │ 0.688 │ 0.655 │ 0.087 (7.3x) │ 0.107 (6.4x) │ 0.094 (7.0x) │ | |
| │ 1x int all null to native │ 0.322 │ 0.345 │ 0.336 │ 0.069 (4.7x) │ 0.093 (3.7x) │ 0.077 (4.4x) │ | |
| │ 1x int all null to arrow │ 0.412 │ 0.434 │ 0.425 │ 0.077 (5.4x) │ 0.080 (5.4x) │ 0.078 (5.5x) │ | |
| │ 20x bit to polars │ 0.184 │ 0.213 │ 0.197 │ 0.096 (1.9x) │ 0.118 (1.8x) │ 0.103 (1.9x) │ | |
| │ 1x bit to polars │ 0.504 │ 0.528 │ 0.513 │ 0.100 (5.1x) │ 0.100 (5.3x) │ 0.100 (5.1x) │ | |
| │ 1x bit to pandas │ 0.491 │ 0.494 │ 0.493 │ 0.096 (5.1x) │ 0.096 (5.1x) │ 0.096 (5.1x) │ | |
| │ 1x bit to json │ 0.655 │ 0.667 │ 0.659 │ 0.117 (5.6x) │ 0.127 (5.3x) │ 0.123 (5.3x) │ | |
| │ 1x bit to native │ 0.347 │ 0.349 │ 0.348 │ 0.095 (3.6x) │ 0.096 (3.6x) │ 0.096 (3.6x) │ | |
| │ 1x bit to arrow │ 0.430 │ 0.455 │ 0.438 │ 0.107 (4.0x) │ 0.119 (3.8x) │ 0.111 (3.9x) │ | |
| │ 20x float to polars │ 0.263 │ 0.281 │ 0.274 │ 0.160 (1.6x) │ 0.171 (1.6x) │ 0.166 (1.7x) │ | |
| │ 1x float to polars │ 0.569 │ 0.580 │ 0.573 │ 0.114 (5.0x) │ 0.125 (4.7x) │ 0.121 (4.7x) │ | |
| │ 1x float to pandas │ 0.564 │ 0.588 │ 0.580 │ 0.113 (5.0x) │ 0.153 (3.8x) │ 0.132 (4.4x) │ | |
| │ 1x float to json │ 0.803 │ 0.854 │ 0.832 │ 0.147 (5.5x) │ 0.202 (4.2x) │ 0.173 (4.8x) │ | |
| │ 1x float to native │ 0.359 │ 0.392 │ 0.381 │ 0.139 (2.6x) │ 0.158 (2.5x) │ 0.146 (2.6x) │ | |
| │ 1x float to arrow │ 0.484 │ 0.516 │ 0.501 │ 0.122 (4.0x) │ 0.215 (2.4x) │ 0.155 (3.2x) │ | |
| │ 20x decimal to polars │ 1.291 │ 1.301 │ 1.298 │ 0.258 (5.0x) │ 0.289 (4.5x) │ 0.269 (4.8x) │ | |
| │ 1x decimal to polars │ 1.075 │ 1.105 │ 1.088 │ 0.168 (6.4x) │ 0.196 (5.6x) │ 0.182 (6.0x) │ | |
| │ 1x decimal to pandas │ 0.969 │ 0.982 │ 0.973 │ 0.180 (5.4x) │ 0.204 (4.8x) │ 0.191 (5.1x) │ | |
| │ 1x decimal to json │ 0.972 │ 1.023 │ 0.991 │ 0.220 (4.4x) │ 0.232 (4.4x) │ 0.224 (4.4x) │ | |
| │ 1x decimal to native │ 0.553 │ 0.562 │ 0.556 │ 0.160 (3.5x) │ 0.192 (2.9x) │ 0.175 (3.2x) │ | |
| │ 1x decimal to arrow │ 1.225 │ 1.236 │ 1.232 │ 0.170 (7.2x) │ 0.198 (6.2x) │ 0.180 (6.8x) │ | |
| │ 20x date to polars │ 0.419 │ 0.430 │ 0.425 │ 0.173 (2.4x) │ 0.186 (2.3x) │ 0.178 (2.4x) │ | |
| │ 1x date to polars │ 0.635 │ 0.665 │ 0.655 │ 0.135 (4.7x) │ 0.135 (4.9x) │ 0.135 (4.9x) │ | |
| │ 1x date to pandas │ 0.589 │ 0.607 │ 0.601 │ 0.106 (5.5x) │ 0.146 (4.2x) │ 0.128 (4.7x) │ | |
| │ 1x date to json │ 1.014 │ 1.042 │ 1.024 │ 0.179 (5.7x) │ 0.199 (5.2x) │ 0.186 (5.5x) │ | |
| │ 1x date to native │ 0.420 │ 0.457 │ 0.440 │ 0.130 (3.2x) │ 0.135 (3.4x) │ 0.133 (3.3x) │ | |
| │ 1x date to arrow │ 0.512 │ 0.539 │ 0.527 │ 0.118 (4.3x) │ 0.141 (3.8x) │ 0.130 (4.1x) │ | |
| │ 20x time_6 to polars │ 1.069 │ 1.085 │ 1.079 │ 0.281 (3.8x) │ 0.374 (2.9x) │ 0.320 (3.4x) │ | |
| │ 1x time_6 to polars │ 0.703 │ 0.716 │ 0.708 │ 0.170 (4.1x) │ 0.219 (3.3x) │ 0.196 (3.6x) │ | |
| │ 1x time_6 to pandas │ 0.640 │ 0.678 │ 0.653 │ 0.177 (3.6x) │ 0.220 (3.1x) │ 0.196 (3.3x) │ | |
| │ 1x time_6 to json │ 1.052 │ 1.096 │ 1.068 │ 0.208 (5.1x) │ 0.252 (4.4x) │ 0.235 (4.5x) │ | |
| │ 1x time_6 to native │ 0.487 │ 0.511 │ 0.499 │ 0.187 (2.6x) │ 0.200 (2.6x) │ 0.193 (2.6x) │ | |
| │ 1x time_6 to arrow │ 0.600 │ 0.604 │ 0.601 │ 0.165 (3.6x) │ 0.198 (3.0x) │ 0.182 (3.3x) │ | |
| │ 20x datetime to polars │ 0.651 │ 0.663 │ 0.659 │ 0.163 (4.0x) │ 0.167 (4.0x) │ 0.164 (4.0x) │ | |
| │ 1x datetime to polars │ 0.733 │ 0.759 │ 0.750 │ 0.113 (6.5x) │ 0.153 (5.0x) │ 0.133 (5.6x) │ | |
| │ 1x datetime to pandas │ 0.716 │ 0.740 │ 0.726 │ 0.136 (5.2x) │ 0.226 (3.3x) │ 0.166 (4.4x) │ | |
| │ 1x datetime to json │ 1.267 │ 1.293 │ 1.283 │ 0.234 (5.4x) │ 0.261 (4.9x) │ 0.248 (5.2x) │ | |
| │ 1x datetime to native │ 0.474 │ 0.531 │ 0.505 │ 0.130 (3.6x) │ 0.133 (4.0x) │ 0.131 (3.9x) │ | |
| │ 1x datetime to arrow │ 0.647 │ 0.671 │ 0.658 │ 0.119 (5.4x) │ 0.139 (4.8x) │ 0.130 (5.1x) │ | |
| │ 20x datetime2_6 to polars │ 0.717 │ 0.727 │ 0.721 │ 0.190 (3.8x) │ 0.230 (3.2x) │ 0.211 (3.4x) │ | |
| │ 1x datetime2_6 to polars │ 0.784 │ 0.800 │ 0.792 │ 0.130 (6.0x) │ 0.175 (4.6x) │ 0.152 (5.2x) │ | |
| │ 1x datetime2_6 to pandas │ 0.738 │ 0.777 │ 0.761 │ 0.128 (5.8x) │ 0.174 (4.5x) │ 0.152 (5.0x) │ | |
| │ 1x datetime2_6 to json │ 1.308 │ 1.322 │ 1.314 │ 0.248 (5.3x) │ 0.253 (5.2x) │ 0.251 (5.2x) │ | |
| │ 1x datetime2_6 to native │ 0.492 │ 0.526 │ 0.513 │ 0.159 (3.1x) │ 0.173 (3.0x) │ 0.166 (3.1x) │ | |
| │ 1x datetime2_6 to arrow │ 0.684 │ 0.712 │ 0.694 │ 0.151 (4.5x) │ 0.186 (3.8x) │ 0.166 (4.2x) │ | |
| │ 20x smalldatetime to polars │ 0.661 │ 0.663 │ 0.662 │ 0.170 (3.9x) │ 0.202 (3.3x) │ 0.181 (3.7x) │ | |
| │ 1x smalldatetime to polars │ 0.752 │ 0.763 │ 0.758 │ 0.111 (6.8x) │ 0.142 (5.4x) │ 0.124 (6.1x) │ | |
| │ 1x smalldatetime to pandas │ 0.703 │ 0.728 │ 0.713 │ 0.122 (5.7x) │ 0.136 (5.4x) │ 0.127 (5.6x) │ | |
| │ 1x smalldatetime to json │ 1.240 │ 1.259 │ 1.249 │ 0.181 (6.9x) │ 0.217 (5.8x) │ 0.193 (6.5x) │ | |
| │ 1x smalldatetime to native │ 0.480 │ 0.494 │ 0.487 │ 0.103 (4.7x) │ 0.141 (3.5x) │ 0.119 (4.1x) │ | |
| │ 1x smalldatetime to arrow │ 0.659 │ 0.670 │ 0.666 │ 0.133 (4.9x) │ 0.140 (4.8x) │ 0.136 (4.9x) │ | |
| │ 20x datetimeoffset_6 to polars │ 3.459 │ 3.468 │ 3.463 │ 0.212 (16.3x) │ 0.217 (16.0x) │ 0.214 (16.2x) │ | |
| │ 1x datetimeoffset_6 to polars │ 2.200 │ 2.231 │ 2.212 │ 0.157 (14.0x) │ 0.175 (12.8x) │ 0.166 (13.3x) │ | |
| │ 1x datetimeoffset_6 to pandas │ 1.645 │ 1.662 │ 1.656 │ 0.158 (10.4x) │ 0.169 (9.8x) │ 0.164 (10.1x) │ | |
| │ 1x datetimeoffset_6 to json │ 2.396 │ 2.410 │ 2.404 │ 0.212 (11.3x) │ 0.244 (9.9x) │ 0.232 (10.3x) │ | |
| │ 1x datetimeoffset_6 to native │ 1.343 │ 1.361 │ 1.351 │ 0.157 (8.5x) │ 0.167 (8.2x) │ 0.161 (8.4x) │ | |
| │ 1x datetimeoffset_6 to arrow │ 1.560 │ 1.573 │ 1.564 │ 0.155 (10.1x) │ 0.172 (9.2x) │ 0.163 (9.6x) │ | |
| │ 20x uniqueidentifier to polars │ 2.487 │ 2.637 │ 2.584 │ 0.581 (4.3x) │ 0.606 (4.3x) │ 0.590 (4.4x) │ | |
| │ 1x uniqueidentifier to polars │ 1.824 │ 1.841 │ 1.834 │ 0.331 (5.5x) │ 0.352 (5.2x) │ 0.342 (5.4x) │ | |
| │ 1x uniqueidentifier to pandas │ 1.427 │ 1.436 │ 1.431 │ 0.318 (4.5x) │ 0.341 (4.2x) │ 0.333 (4.3x) │ | |
| │ 1x uniqueidentifier to json │ 2.053 │ 2.080 │ 2.066 │ 0.363 (5.7x) │ 0.373 (5.6x) │ 0.367 (5.6x) │ | |
| │ 1x uniqueidentifier to native │ 1.155 │ 1.169 │ 1.160 │ 0.317 (3.6x) │ 0.349 (3.4x) │ 0.329 (3.5x) │ | |
| │ 20x varbinary_4 to polars │ 0.291 │ 0.344 │ 0.323 │ 0.150 (1.9x) │ 0.183 (1.9x) │ 0.163 (2.0x) │ | |
| │ 1x varbinary_4 to polars │ 0.535 │ 0.562 │ 0.552 │ 0.103 (5.2x) │ 0.104 (5.4x) │ 0.103 (5.4x) │ | |
| │ 1x varbinary_4 to pandas │ 0.527 │ 0.576 │ 0.546 │ 0.115 (4.6x) │ 0.136 (4.2x) │ 0.122 (4.5x) │ | |
| │ 1x varbinary_4 to native │ 0.377 │ 0.403 │ 0.388 │ 0.106 (3.6x) │ 0.128 (3.2x) │ 0.116 (3.4x) │ | |
| │ 1x varbinary_4 to arrow │ 0.492 │ 0.519 │ 0.502 │ 0.112 (4.4x) │ 0.119 (4.4x) │ 0.115 (4.3x) │ | |
| │ 20x varbinary_100 to polars │ 2.070 │ 2.190 │ 2.116 │ 1.773 (1.2x) │ 1.803 (1.2x) │ 1.784 (1.2x) │ | |
| │ 1x varbinary_100 to polars │ 1.382 │ 1.415 │ 1.395 │ 0.895 (1.5x) │ 0.910 (1.6x) │ 0.903 (1.5x) │ | |
| │ 1x varbinary_100 to pandas │ 1.339 │ 1.347 │ 1.342 │ 0.887 (1.5x) │ 0.894 (1.5x) │ 0.892 (1.5x) │ | |
| │ 1x varbinary_100 to native │ 1.132 │ 1.145 │ 1.139 │ 0.887 (1.3x) │ 0.895 (1.3x) │ 0.890 (1.3x) │ | |
| │ 1x varbinary_100 to arrow │ 1.305 │ 1.327 │ 1.315 │ 0.887 (1.5x) │ 0.900 (1.5x) │ 0.893 (1.5x) │ | |
| │ 20x varbinary_max to polars │ 2.294 │ 2.309 │ 2.301 │ 2.015 (1.1x) │ 2.038 (1.1x) │ 2.026 (1.1x) │ | |
| │ 1x varbinary_max to polars │ 1.503 │ 1.529 │ 1.520 │ 1.014 (1.5x) │ 1.025 (1.5x) │ 1.019 (1.5x) │ | |
| │ 1x varbinary_max to pandas │ 1.450 │ 1.462 │ 1.456 │ 1.007 (1.4x) │ 1.013 (1.4x) │ 1.010 (1.4x) │ | |
| │ 1x varbinary_max to native │ 1.263 │ 1.265 │ 1.264 │ 1.007 (1.3x) │ 1.018 (1.2x) │ 1.012 (1.2x) │ | |
| │ 1x varbinary_max to arrow │ 1.440 │ 1.457 │ 1.448 │ 1.007 (1.4x) │ 1.033 (1.4x) │ 1.019 (1.4x) │ | |
| │ 20x varchar_10 to polars │ 0.273 │ 0.296 │ 0.288 │ 0.136 (2.0x) │ 0.177 (1.7x) │ 0.150 (1.9x) │ | |
| │ 1x varchar_10 to polars │ 0.518 │ 0.594 │ 0.558 │ 0.115 (4.5x) │ 0.147 (4.1x) │ 0.126 (4.4x) │ | |
| │ 1x varchar_10 to pandas │ 0.570 │ 0.590 │ 0.582 │ 0.096 (5.9x) │ 0.136 (4.3x) │ 0.110 (5.3x) │ | |
| │ 1x varchar_10 to json │ 0.713 │ 0.740 │ 0.722 │ 0.148 (4.8x) │ 0.156 (4.7x) │ 0.152 (4.8x) │ | |
| │ 1x varchar_10 to native │ 0.375 │ 0.381 │ 0.379 │ 0.100 (3.8x) │ 0.118 (3.2x) │ 0.109 (3.5x) │ | |
| │ 1x varchar_10 to arrow │ 0.446 │ 0.506 │ 0.481 │ 0.116 (3.8x) │ 0.140 (3.6x) │ 0.125 (3.8x) │ | |
| │ 20x nvarchar_10 to polars │ 0.352 │ 0.355 │ 0.353 │ 0.222 (1.6x) │ 0.230 (1.5x) │ 0.225 (1.6x) │ | |
| │ 1x nvarchar_10 to polars │ 0.553 │ 0.578 │ 0.566 │ 0.128 (4.3x) │ 0.141 (4.1x) │ 0.132 (4.3x) │ | |
| │ 1x nvarchar_10 to pandas │ 0.573 │ 0.595 │ 0.586 │ 0.137 (4.2x) │ 0.169 (3.5x) │ 0.149 (3.9x) │ | |
| │ 1x nvarchar_10 to json │ 0.721 │ 0.752 │ 0.741 │ 0.158 (4.6x) │ 0.187 (4.0x) │ 0.169 (4.4x) │ | |
| │ 1x nvarchar_10 to native │ 0.363 │ 0.387 │ 0.377 │ 0.113 (3.2x) │ 0.126 (3.1x) │ 0.117 (3.2x) │ | |
| │ 1x nvarchar_10 to arrow │ 0.484 │ 0.537 │ 0.511 │ 0.114 (4.2x) │ 0.169 (3.2x) │ 0.138 (3.7x) │ | |
| │ 20x nvarchar_10_max to polars │ 0.988 │ 1.021 │ 1.000 │ 0.461 (2.1x) │ 0.483 (2.1x) │ 0.470 (2.1x) │ | |
| │ 1x nvarchar_10_max to polars │ 0.953 │ 0.962 │ 0.957 │ 0.258 (3.7x) │ 0.336 (2.9x) │ 0.303 (3.2x) │ | |
| │ 1x nvarchar_10_max to pandas │ 0.981 │ 0.993 │ 0.987 │ 0.240 (4.1x) │ 0.245 (4.1x) │ 0.243 (4.1x) │ | |
| │ 1x nvarchar_10_max to json │ 1.123 │ 1.145 │ 1.130 │ 0.278 (4.0x) │ 0.288 (4.0x) │ 0.282 (4.0x) │ | |
| │ 1x nvarchar_10_max to native │ 0.773 │ 0.807 │ 0.788 │ 0.241 (3.2x) │ 0.258 (3.1x) │ 0.247 (3.2x) │ | |
| │ 1x nvarchar_10_max to arrow │ 0.881 │ 0.909 │ 0.899 │ 0.240 (3.7x) │ 0.261 (3.5x) │ 0.247 (3.6x) │ | |
| │ 20x nvarchar_100 to polars │ 3.749 │ 3.760 │ 3.754 │ 3.488 (1.1x) │ 3.517 (1.1x) │ 3.498 (1.1x) │ | |
| │ 1x nvarchar_100 to polars │ 2.246 │ 2.312 │ 2.269 │ 1.748 (1.3x) │ 1.770 (1.3x) │ 1.759 (1.3x) │ | |
| │ 1x nvarchar_100 to pandas │ 2.228 │ 2.243 │ 2.235 │ 1.743 (1.3x) │ 1.747 (1.3x) │ 1.745 (1.3x) │ | |
| │ 1x nvarchar_100 to json │ 2.475 │ 2.495 │ 2.483 │ 1.883 (1.3x) │ 1.885 (1.3x) │ 1.884 (1.3x) │ | |
| │ 1x nvarchar_100 to native │ 1.987 │ 1.994 │ 1.991 │ 1.744 (1.1x) │ 1.747 (1.1x) │ 1.745 (1.1x) │ | |
| │ 1x nvarchar_100 to arrow │ 2.168 │ 2.188 │ 2.175 │ 1.741 (1.2x) │ 1.747 (1.3x) │ 1.743 (1.2x) │ | |
| │ 20x nvarchar_100_max to polars │ 3.950 │ 3.988 │ 3.970 │ 3.723 (1.1x) │ 3.744 (1.1x) │ 3.734 (1.1x) │ | |
| │ 1x nvarchar_100_max to polars │ 2.354 │ 2.378 │ 2.365 │ 1.869 (1.3x) │ 1.877 (1.3x) │ 1.872 (1.3x) │ | |
| │ 1x nvarchar_100_max to pandas │ 2.349 │ 2.362 │ 2.354 │ 1.863 (1.3x) │ 1.875 (1.3x) │ 1.868 (1.3x) │ | |
| │ 1x nvarchar_100_max to json │ 2.594 │ 2.641 │ 2.612 │ 1.989 (1.3x) │ 1.998 (1.3x) │ 1.995 (1.3x) │ | |
| │ 1x nvarchar_100_max to native │ 2.120 │ 2.134 │ 2.125 │ 1.862 (1.1x) │ 1.885 (1.1x) │ 1.870 (1.1x) │ | |
| │ 1x nvarchar_100_max to arrow │ 2.286 │ 2.295 │ 2.292 │ 1.862 (1.2x) │ 1.873 (1.2x) │ 1.866 (1.2x) │ | |
| └─────────────────────────────────┴─────────┴─────────┴─────────┴─────────────────┴─────────────────┴─────────────────┘ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment