Azure Functions : Compiled or interpreted C#… What impact does it have on my performance?


Last week I did a post about how to integrate Compiled Azure Functions working with VSTS… In the closing thoughts I made a statement about my observation that compiled functions had a performance improvement.


Here I should have known Nills would challenge me on that… 😉


So… #challengeaccepted


Test Scenario

What will be the test bed for today?

  • Two functions in a separate consumption plan.
  • Both will be hosted in West Europe on Windows.
  • One will have compiled code (right-click-publish …oops… from VS).

  • The other will have interpreted code.
  • Both will have the same code (being the starting template for an http trigger).
  • Performance testing will be done by invoking the url via webstresstest from a virtual machine in Azure (also located in West Europe).
  • So the test will run for 5 minutes generating about 100 url invocations per second.
  • We’ll use (a different) appinsights to measure the functions at the lowest level. Where we’ll use the results from webstresstest to see the end-to-end performance.


I would recon this is a fair test bed to compare both without giving advantage to one or another… So let’s see what the results were?


Test Results for “Compiled”

When following the load test via the “Live Metrics Stream” of Application Insights, we can see that the request during is give or take stable between 1 and 2 ms.


Now let’s check the results of the webstresstest ;

Here we can see that the average time per request has been 49ms (clientside / end-to-end viewpoint) for the 26,5k requests we generated.

When looking towards the backend function part, we can see that the average response time was 1,28ms.



Test Results for “Interpreted”

When looking towards the “interpreted” scenario, we see the same flow with the Live Metrics Stream. Though we notice a minor “jump” in the response times from time to time (to 3 a 4 ms).

And what does webstresstest say?

We’re averaging out at 71ms here (compared to 49 with compiled).

Where the functions backed clocked the response times at 1,78ms (compared to 1,28ms for compiled).


Closing Thoughts

Let’s create a super professional comparison chart out of the results… 😉

Where we notice that there is a performance impact. Being that this test is still below the few ms, a user will probably not notice this at all. Though be aware that for time, or bigger calculations, this might affect you!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.