Skip to content

Conversation

@rimijoker
Copy link

@rimijoker rimijoker commented Jan 27, 2026

Summary

Refactor splitPart to reduce memory allocations during string parsing/splitting operations.

Motivation

The previous implementation of splitPart created many short-lived intermediate objects (substrings / temporary buffers), which increased GC pressure and decreased throughput under high load. This refactor reduces those allocations to improve performance and memory efficiency in hot code paths.

What changed

  • Rewrote splitPart to avoid creating intermediate String objects and temporary buffers where possible.
  • Uses index-based parsing / reuses buffers (or an existing reusable structure) to produce the split parts without unnecessary allocations.
  • Preserves the original behavior and public contract of splitPart.

@rimijoker rimijoker changed the title Refactor splitPart function to enhance delimiter handling and support… Refactor splitPart function to reduce memory allocation Jan 27, 2026
@rimijoker rimijoker force-pushed the feature/improve-splitpart-function branch from dd2d5b0 to 1a1fb12 Compare January 27, 2026 15:07
@rimijoker rimijoker force-pushed the feature/improve-splitpart-function branch from 1a1fb12 to fce2361 Compare January 27, 2026 16:33
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