Skip to content

Conversation

@khresth
Copy link

@khresth khresth commented Oct 24, 2025

Description

Optimized the pick() function to improve performance by eliminating intermediate array allocations. The original implementation used keys.map() to create an array of [key, value] tuples, then converted it to an object via Object.fromEntries(). This created temporary data structures on every invocation.

The new implementation directly constructs the result object in a single loop, reducing memory allocations and iteration overhead. Since pick() is called twice per API request (for query params and body params), this optimization should improve performance across SDK operations.

How was this change tested?

  • Automated test (unit, integration, etc.)
  • Manual test (provide reproducible testing steps below)
bash node node_modules\jest\bin\jest.js ./test 

Test Results:

PASS test/id-extraction.test.ts
PASS test/helpers.test.ts
PASS test/Client.test.ts

Test Suites: 3 passed, 3 total
Tests: 24 passed, 24 total

Screenshots

image
@CLAassistant
Copy link

CLAassistant commented Oct 24, 2025

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

2 participants