Skip to content

chore: refactor code to reduce object creations - #172

Merged
ath-08 merged 3 commits into
mainfrom
refactor
Jul 30, 2025
Merged

chore: refactor code to reduce object creations#172
ath-08 merged 3 commits into
mainfrom
refactor

Conversation

@mayurkale22

@mayurkale22 mayurkale22 commented Jul 30, 2025

Copy link
Copy Markdown
Collaborator

Summary of Changes

  • Optimized constructPayload: Eliminated intermediate byte[] arrays and data copies. The header and body are now read directly into a single, correctly-sized payload array.

  • Reduced Map Allocation: A new HashMap for attachments is no longer created for every request.

  • Static Contexts: The defaultContext and defaultContextWithLAR are now static final as they are thread-safe and don't depend on instance state.

@mayurkale22
mayurkale22 requested a review from ath-08 July 30, 2025 17:49
@mayurkale22
mayurkale22 requested a review from ath-08 July 30, 2025 19:06
@ath-08
ath-08 merged commit 7ac34ea into main Jul 30, 2025
16 checks passed
@ath-08
ath-08 deleted the refactor branch July 30, 2025 23:42
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