您是否想知道 Azure 上的 Polars Deltalake 与消费级笔记本电脑的性能相比如何?
不?嗯,我有。如果我激起了您的好奇心,请继续阅读。
以下是参赛者
请参阅定价以获取可用应用服务计划的完整列表。
测试测量三种场景
代码通过 REST API 端点执行:
在 HP EliteBook 上,我使用 func start 启动 https://localhost:7071。
要发布到 Azure I,请按照 https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python
中的说明进行操作
搭建必要的开发环境。这使我能够通过
发布该函数
func azure functionapp 发布 function-hekori-learning-002.
我使用 terraform 在北欧区域设置了 Azure 资源。
这是一个代码片段,显示访问 https://function-hekori-learning-002.azurewebsites.net/api/polars/azure/read
时执行的代码
@app.route(route="polars/azure/read", auth_level=func.AuthLevel.ANONYMOUS) def polars_azure_read(req: func.HttpRequest) -> func.HttpResponse: logging.info('Reading from delta table') tic = time.time() df = pl.read_delta(AZURE_STORAGE_PATH, storage_options=storage_options ) df = df.sql( "select sum(value) as sum, avg(value) as mean, count() as count, name from self group by name order by sum asc" ) toc = time.time() logging.info(f"Elapsed time {toc - tic:.2f} seconds") return func.HttpResponse( "Success from polars." + str(df) + '\n' + "Elapsed time " + str(toc - tic) + " seconds", status_code=200 )
正如我们所见,HP EliteBook 在所有情况下都快了大约一个数量级。
这是我个人的解读
请注意,增量表的大小较小,只有 3 个提交和 2 个 parquet 文件。即,运行时有效地测量计算单元访问文件的开销。
如果您❤️这篇文章,并且想要查看更大数据集的更多基准测试结果以进行核心处理,请给这篇文章一个?
并订阅?到我的频道???.
以上是Polars Delta Lake:小数据方面的 Azure Function 与笔记本电脑的详细内容。更多信息请关注PHP中文网其他相关文章!