我们是否为 Azure Functions 上使用的 .csx 文件支付编译时间?

Do we pay for compilation time for .csx files used on Azure Functions?

我目前正在学习新的 Microsoft 认证,Azure Functions 文档中的这段代码引起了我的注意 (link):

The Azure Functions Tools provides the following benefits:

  • Edit, build, and run functions on your local development computer.
  • Publish your Azure Functions project directly to Azure.
  • Use WebJobs attributes to declare function bindings directly in the C# code instead of maintaining a separate function.json for binding definitions.
  • Develop and deploy pre-compiled C# functions. Pre-complied functions provide a better cold-start performance than C# script-based functions.
  • Code your functions in C# while having all of the benefits of Visual Studio development.

我理解冷启动性能指的是 csx 文件在使用前必须编译。

我开始怀疑编译 csx 是否有成本(价格方面),如果存在它是否有意义?如果它只对给定版本的 Function 完成一次,那么它应该不会引起注意。

我不知道你是否为编译时间付费,但我愿意 肯定是这样。

我知道 "is it a meaningful cost" 的答案。 在消费定价计划中,服务通常会在调用后 "warm" 停留约 20 分钟(非官方,无法保证)。因此,如果您通常不到 20 分钟调用一次,那么您很可能会为每次调用支付编译成本。但是,考虑到时间成本和频率,随着时间的推移,它的成本加起来会非常小;我个人认为这不是有意义的成本。