  The Function-as-a-Service (FaaS) execution model increases developer
productivity by removing operational concerns such as managing hardware or
software runtimes. Developers, however, still need to partition their
applications into FaaS functions, which is error-prone and complex:
Encapsulating only the smallest logical unit of an application as a FaaS
function maximizes flexibility and reusability. Yet, it also leads to
invocation overheads, additional cold starts, and may increase cost due to
double billing during synchronous invocations. Conversely, deploying an entire
application as a single FaaS function avoids these overheads but decreases
flexibility. In this paper we present Fusionize, a framework that automates
optimizing for this trade-off by automatically fusing application code into an
optimized multi-function composition. Developers only need to write
fine-grained application code following the serverless model, while Fusionize
automatically fuses different parts of the application into FaaS functions,
manages their interactions, and configures the underlying infrastructure. At
runtime, it monitors application performance and adapts it to minimize
request-response latency and costs. Real-world use cases show that Fusionize
can improve the deployment artifacts of the application, reducing both median
request-response latency and cost of an example IoT application by more than
35%.
