Two .NET 6 features — PublishTrimmed and ReadyToRun — can significantly improve AWS Lambda custom runtime cold start times and deployment speeds. Enabling PublishTrimmed in the .csproj file reduced one example deployment package from 31.4 MB to 14.4 MB, with roughly 30% cold start improvement. ReadyToRun performs ahead-of-time compilation to reduce startup delays, though it increases package size. Both features are most impactful when using a custom runtime rather than a managed Lambda runtime.

2m read timeFrom nodogmablog.bryanhogan.net
Post cover image