0

I have an Express server running in firebase cloud function.

Currently, I am calling this cloud function from my client (assume it's a web client) using direct http call to url that was provided to me to access the function.

However, there is another method to call this function which is using thr firebase cloud function library for the client.

My question is : what advantage do I get ( in terms of speed ) if I use the library instead of the direct http call.

My assumption is that the library uses a web socket to accesd the function whereas the direct http call uses http call

I couldn't find anywhere in the documentation saying which one is better

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
TSR
  • 17,242
  • 27
  • 93
  • 197

1 Answers1

0

Callable functions invoked using the Firebase SDK were not designed to provide any sort of increase in performance over a normal HTTP request. In fact, on average, you will hardly notice any difference between the two.

It's better to pick the one that meets your needs and preferences rather than thinking about performance. But if you really must choose the one that's faster, you should benchmark your choices yourself to see which one is better for your specific case.

See also: Are Callable Cloud Functions better than HTTP functions?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441