LibProf: A Python Profiler for Improving Cold Start Performance in Serverless Applications
Syed Salauddin Mohammad Tariq, Ali Al Zein, Soumya Sripad Vaidya, Arati Khanolkar, Probir Roy
TL;DR
LibProf tackles serverless Python cold-start latency by revealing library initialization as a dominant overhead. It uses dynamic, sampling-based call-path profiling to build a calling-context aware view of library usage and ties samples to libraries with a utilization metric, enabling targeted optimizations. Across 15 applications, LibProf identifies four inefficiency patterns and guides lazy-loading and other refinements, yielding up to $2.30 imes$ initialization speedups, $2.26 imes$ cold-start execution speedups, and $1.51 imes$ memory reductions. The approach is non-intrusive (no privileged runtime access) and shows clear practical impact, though it currently operates in Python and cannot instrument native code paths. Overall, LibProf provides a measurable, developer-guided pathway to mitigate serverless cold-start latency via library-level optimizations.
Abstract
Serverless computing abstracts away server management, enabling automatic scaling and efficient resource utilization. However, cold-start latency remains a significant challenge, affecting end-to-end performance. Our preliminary study reveals that inefficient library initialization and usage are major contributors to this latency in Python-based serverless applications. We introduce LibProf, a Python profiler that uses dynamic program analysis to identify inefficient library initializations. LibProf collects library usage data through statistical sampling and call-path profiling, then generates a report to guide developers in addressing four types of inefficiency patterns. Systematic evaluations on 15 serverless applications demonstrate that LibProf effectively identifies inefficiencies. LibProf guided optimization results up to 2.26x speedup in cold-start execution time and 1.51x reduction in memory usage.
