Skip to content

feat(node-sdk): decrease memory usage of rate limiter slightly#379

Merged
roncohen merged 8 commits intomainfrom
use-base64-for-memory-efficiency
Mar 24, 2025
Merged

feat(node-sdk): decrease memory usage of rate limiter slightly#379
roncohen merged 8 commits intomainfrom
use-base64-for-memory-efficiency

Conversation

@roncohen
Copy link
Contributor

@roncohen roncohen commented Mar 18, 2025

Examples:

- 4cfdc69d4aa5521884b5e2558f9d7018b51b8bfa
+ TP3GnUqlUhiEteJVj51wGLUbi/o=

- 4e42ddd9f3c2e5232626829c2208936a985736e3
+ TkLd2fPC5SMmJoKcIgiTaphXNuM=

I tested the performance impact of this change in a microbenchmark and saw no significant change:

     name                                 hz     min     max    mean     p75     p99    p995    p999     rme  samples
   · hashObject with hex encoding     406.29  2.1929  2.9307  2.4613  2.5955  2.9214  2.9215  2.9307  ±1.02%      204   fastest
   · hashObject with base64 encoding  398.01  2.2055  4.4220  2.5125  2.6363  3.0233  3.1191  4.4220  ±1.32%      200

 BENCH  Summary

  hashObject with hex encoding - test/hashobj.bench.ts > 
    1.02x faster than hashObject with base64 encoding

@roncohen roncohen enabled auto-merge (squash) March 18, 2025 09:27
@roncohen roncohen disabled auto-merge March 18, 2025 09:30
@roncohen roncohen changed the title feat: decrease memory usage of rate limiter slightly feat(node-sdk): decrease memory usage of rate limiter slightly Mar 18, 2025
@roncohen roncohen enabled auto-merge (squash) March 18, 2025 09:30
@roncohen roncohen disabled auto-merge March 18, 2025 11:00
@roncohen roncohen enabled auto-merge (squash) March 18, 2025 11:00
@roncohen roncohen disabled auto-merge March 18, 2025 11:00
@roncohen roncohen enabled auto-merge (squash) March 18, 2025 11:00
@roncohen roncohen requested a review from pavkam March 24, 2025 14:49
@roncohen roncohen disabled auto-merge March 24, 2025 14:54
@roncohen roncohen enabled auto-merge March 24, 2025 14:54
@roncohen roncohen added this pull request to the merge queue Mar 24, 2025
Merged via the queue into main with commit ede2549 Mar 24, 2025
5 checks passed
@roncohen roncohen deleted the use-base64-for-memory-efficiency branch March 24, 2025 16:12
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