DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node
Apache License 2.0
105 stars 35 forks source link

chore: lazy load internal request module #519

Closed duncanista closed 3 months ago

duncanista commented 3 months ago

What does this PR do?

Reduces memory allocation for this package by lazy loading internal request.ts methods.

Before:

Screenshot 2024-03-20 at 3 19 36 PM

After:

Screenshot 2024-03-20 at 3 17 40 PM

Motivation

It was possible to reduce the memory allocations + performance.

Testing Guidelines

Additional Notes

SVLS-4628

Allocation time can vary, but now we are sure that the lazy load is in effect.

Types of Changes

Check all that apply

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 89.28571% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 81.90%. Comparing base (e08ad86) to head (a1247d1).

:exclamation: Current head a1247d1 differs from pull request most recent head 6cc0816. Consider uploading reports for the commit 6cc0816 to get more accurate results

Files Patch % Lines
src/metrics/listener.ts 87.50% 2 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #519 +/- ## ========================================== - Coverage 81.95% 81.90% -0.06% ========================================== Files 54 54 Lines 2206 2205 -1 Branches 512 513 +1 ========================================== - Hits 1808 1806 -2 + Misses 334 333 -1 - Partials 64 66 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.