Skip to content

Conversation

@Ayoub-Mabrouk
Copy link

Remove lodash dependency for faster property access
Pre-calculate range in closure to avoid repeated subtraction on each call
Add early return optimization for constant values (min === max)
-Use modern JS features (default parameters, arrow functions)

The range calculation is moved from the hot path (next() function) to
the closure scope, ensuring it's computed only once when the backoff
function is created rather than on every invocation

- Remove lodash dependency for faster property access
- Pre-calculate range in closure to avoid repeated subtraction on each call
- Add early return optimization for constant values (min === max)
- Use modern JS features (default parameters, arrow functions)

The range calculation is moved from the hot path (next() function) to
the closure scope, ensuring it's computed only once when the backoff
function is created rather than on every invocation.
Copy link
Collaborator

@cressie176 cressie176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ayoub-Mabrouk
Copy link
Author

Thanks @Ayoub-Mabrouk

Thanks! Also, PR #72 is approved and just needs your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants