逻辑应用程序与天蓝色功能相比速度较慢 [英] Logic apps slow compared to azure functions

查看:81
本文介绍了逻辑应用程序与天蓝色功能相比速度较慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个快速测试来比较Logic Apps和Azure函数之间的速度,因为我担心为什么要花这么长时间通过HTTP从azure sql返回记录.

I did a quick test to compare speed between Logic Apps and Azure functions because i was concerned why it takes so long to return records from azure sql by HTTP.

逻辑应用程序功能包括3个步骤:

Logic app function had 3 steps:

1.Http获取触发器

1.Http get trigger

2.执行sql过程(比分页2048条记录的获取行"要快得多)

2.Execute sql procedure (much faster than 'get rows' which paginates over 2048 records)

3.响应

Azure函数为:

1. http获取触发器

1. http get trigger

2.SQLConnection通过连接字符串,然后通过SqlDataReader读取行,将其放入DataTable,最后创建json.

2.SQLConnection by connection string then reading rows by SqlDataReader putting them to DataTable and finally creating json.

3.用json

对于27,000行样本,结果如​​下:

For sample 27k rows results were like this:

天蓝色功能:大约8-9秒

Azure function: about 8-9 seconds

逻辑应用程序:17-21秒

Logic app: 17-21 seconds

结果是一致的,数据库不是这里的问题.

Results are consistent and database is not the issue here.

请解释为什么在大多数情况下,即使在小产量情况下,差异如此之大,甚至超过100%.

Please explain why there is such massive difference which is over 100% most of the time (even for small outputs).

谢谢

推荐答案

嘿,所以,由于Logics Apps使用的都是REST API上的预构建连接器,因此开销更大而且无论作业大小,它们都运行相同的基础逻辑.借助功能,您可以灵活地优化流程 当您编写代码时.此外,由于依赖关系会增加开销和执行时间,因此功能只能在本地(或无服务器)运行,而Logic App只能在Azure上运行.

Hey, so because Logics Apps uses pre-built connectors which are all over REST APIs, it's more overhead and they run the same underlying logic regardless of if the job is large or small. With functions you have a lot more flexibility to optimize the processes when you write the code. Also, Functions can be run locally (or serverless), versus Logic App that can only be run on Azure because of dependencies which adds to the overhead and execution time. 

您的作业虽然没有使用相同的SQL get方法,但应将其考虑在内.

Your jobs didn't use the same SQL get methods though and that should be taken into consideration.


这篇关于逻辑应用程序与天蓝色功能相比速度较慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆