Patent attributes
Systems and methods are described for managing dependencies among code in an on-demand code execution system in a manner that enables efficient execution of the code. A user may generate a task on the system by submitting code, which may reference additional code on the system. The system can determine a dependency graph for the submitted code, and generate packages for the task based at least partly on the dependency graph. On receiving a request to execute the task, the system can provision an execution environment with the packages, and execute the code of the task. The packages may be selected based on analysis of the dependency graph, such that execution of the task on the on-demand code execution system is expected to satisfy a desired execution metric, which may include a maximum time to begin executing code of a task subsequent to receiving a request to execute the task.