Skip to content

perf: replace StringBuilder with ValueStringBuilder#2270

Open
TimothyMakkison wants to merge 1 commit into
reactiveui:mainfrom
TimothyMakkison:separated_value_string
Open

perf: replace StringBuilder with ValueStringBuilder#2270
TimothyMakkison wants to merge 1 commit into
reactiveui:mainfrom
TimothyMakkison:separated_value_string

Conversation

@TimothyMakkison

@TimothyMakkison TimothyMakkison commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Replaces StringBuilder with ValueStringBuilder

  • Might be worth checking if key[1..].ContainsUpper() and early returning
  • ValueStringBuilder uses the ArrayPool.Rent contructor, it could be worth doing conditional creation either using this, or using stackalloc char[]

For example:

var minCapacity = key.Length + SeparatorCapacityHeadroom;
var builder = minCapacity < 256 ? new ValueStringBuilder(stackalloc char[256])
    : new ValueStringBuilder(minCapacity);

@TimothyMakkison
TimothyMakkison force-pushed the separated_value_string branch from 178252b to 69ead54 Compare July 21, 2026 15:25
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