A software team has noticed that a serverless function, which processes incoming streaming data, is occasionally hitting its maximum execution time, resulting in incomplete tasks. The function's workload involves complex computations and varying sizes of data payloads. To enhance the processing efficiency and reduce the likelihood of timeouts, which of the following adjustments should be the team's initial step?
Implement a distributed tracing service to examine the function's behavior in detail.
Allocate more memory to the serverless function.
Manually optimize the function by removing lines of code to decrease the execution time.
Extend the maximum allowed execution time for the function.