Search code examples
google-cloud-platformgoogle-cloud-functionsgoogle-artifact-registry

Is deploying a Google Cloud Function with Artifact Registry faster than using Container Registry?


An email I recently received from GCP mentions the transition to Artifact Registry for Cloud Functions.

It claims:

Cloud Functions for Firebase and Firebase Extensions have historically used Container Registry for packaging functions and managing their deployment, yet with the change to Artifact Registry, you’ll have the following benefits:

Your functions will deploy faster.

You’ll have access to more regions.

I cannot find any more information regarding faster deployments, either from official documentation or from user experiences.

Is there any reason to believe Cloud Function deployment will actually be faster, by an appreciable margin? Currently function deployment is glacial, so even a small speedup in percentage terms would shave minutes off deployment times.


Solution

  • I'm personally surprise of that "faster" deployment mention, because, in reality, it won't.

    To explain that, you simply have to review the deployment process:

    1. You submit your code
    2. Your code is packaged in a container (with Cloud Build and Buildpack) and stored somewhere (in container registry or artifact registry)
    3. The code is deployed on the target service.

    If you take the duration of each step, in percentage you can have:

    1. 0.5% (depend on your network)
    2. 99% (depend on the build to perform, can take long minutes to compile/minify,...)
    3. 0.5% (Even if the container is "big", the petabyte network is wonderful).

    So, yes, you have more regions, and, by the way, if you have a large container to deploy, in a non supported region, the data transfer with take more ms, even a few seconds.


    All of that to say, yes, you can save few seconds, but it's not always the case.