Sitelet https://github.com/belav/csharpier/pull/1708
Skip to content

perf: use Stack.Peek to reduce Pop and Push churn - #1708

Merged
belav merged 2 commits into
belav:mainfrom
TimothyMakkison:peek_docs_stack
Dec 25, 2025
Merged

belav merged 2 commits into
belav:mainfrom
TimothyMakkison:peek_docs_stack

Conversation

@TimothyMakkison

@TimothyMakkison TimothyMakkison commented Oct 16, 2025 •

Copy link
Copy Markdown
Contributor

Not sure if more changes might help here, perhaps calling docsStack.Push(TraverseDocOnExitStackMarker); later and adding an else clause might help, that or using a goto. Might be easier to measure an improvement once other changes were made.

Did wonder if ValueListBuilder will help due to faster Push and Pop.

@belav belav left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@belav
belav enabled auto-merge (squash) December 25, 2025 16:25
@belav
belav merged commit a8ddbc3 into belav:main Dec 25, 2025
7 checks passed
@belav belav added this to the 1.3.0 milestone Dec 25, 2025
belav added a commit that referenced this pull request Dec 31, 2025
Not sure if more changes might help here, perhaps calling
`docsStack.Push(TraverseDocOnExitStackMarker);` later and adding an
`else` clause might help, that or using a goto. Might be easier to
measure an improvement once other changes were made.

Did wonder if `ValueListBuilder` will help due to faster `Push` and
`Pop`.

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
belav added a commit that referenced this pull request Feb 20, 2026
Not sure if more changes might help here, perhaps calling
`docsStack.Push(TraverseDocOnExitStackMarker);` later and adding an
`else` clause might help, that or using a goto. Might be easier to
measure an improvement once other changes were made.

Did wonder if `ValueListBuilder` will help due to faster `Push` and
`Pop`.

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
belav added a commit that referenced this pull request Mar 12, 2026
Not sure if more changes might help here, perhaps calling
`docsStack.Push(TraverseDocOnExitStackMarker);` later and adding an
`else` clause might help, that or using a goto. Might be easier to
measure an improvement once other changes were made.

Did wonder if `ValueListBuilder` will help due to faster `Push` and
`Pop`.

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
belav added a commit that referenced this pull request Apr 4, 2026
Not sure if more changes might help here, perhaps calling
`docsStack.Push(TraverseDocOnExitStackMarker);` later and adding an
`else` clause might help, that or using a goto. Might be easier to
measure an improvement once other changes were made.

Did wonder if `ValueListBuilder` will help due to faster `Push` and
`Pop`.

Co-authored-by: Bela VanderVoort <twobitbela@gmail.com>
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