High performance computing (HPC) in the cloud has been shown to be a viable alternative to on‐premise clusters, especially for loosely coupled or embarrassingly parallel jobs. The traditional approach for a user would be to use the cloud provider's IaaS to provision virtual machines (VM) and use it in a similar manner to an on‐premise cluster. A new paradigm of serverless cloud computing, primarily offered as FaaS, allows a user to execute code in the cloud without any system administration overhead. A comparison is needed to better understand the cost vs performance trade‐off between FaaS and IaaS such that cloud users can decide which approach is suitable for them, however, such a study is lacking. In this paper, we compare Google cloud's FaaS (Cloud Functions) with its IaaS (Compute Engine) in terms of cost and performance for an embarrassingly parallel task. We find that FaaS can be 14% to 40% less expensive than IaaS for the same level of performance. However, performance of FaaS exhibits higher variation since the number of CPUs allocated (scalability) depends on the cloud provider.