Skip to content

perf(duration): avoid transient bound functions - #3197

Open
OskarEichler wants to merge 1 commit into
iamkun:devfrom
OskarEichler:codex/dayjs-duration-call
Open

perf(duration): avoid transient bound functions#3197
OskarEichler wants to merge 1 commit into
iamkun:devfrom
OskarEichler:codex/dayjs-duration-call

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

  • delegate ordinary add and subtract calls with Function#call
  • avoid constructing and immediately invoking a bound function on each non-duration operation

Behavior

This preserves the receiver, arguments, duration-specific branches, return values, and public APIs. It is a focused implementation simplification; no breaking change is intended.

The existing duration suite already covers both ordinary numeric operations and duration operands, so no assertion-only regression was added for this behavior-preserving change.

Verification

  • focused duration suite: 30 tests passed
  • npm test: 93 suites, 794 tests passed
  • npm run lint
  • NODE_OPTIONS=--openssl-legacy-provider npm run build
  • package size remains within the 2.99 KB limit
  • git diff --check

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.

1 participant