Skip to content

small tweak to the SlangNode class#1396

Merged
Janther merged 3 commits intomainfrom
small-improvement
Feb 8, 2026
Merged

small tweak to the SlangNode class#1396
Janther merged 3 commits intomainfrom
small-improvement

Conversation

@Janther
Copy link
Copy Markdown
Member

@Janther Janther commented Feb 1, 2026

Initially this PR had included a small check and early exit when the rest of the execution wouldn't alter anything, but after some profiling, I realised that this was more taxing than just keep the execution untouched.

This inspired me to change the approach of storing leading and trailing offsets.

The important information we need to check is start - leadingOffset and end + trailingOffset. if we store this info into the appropriately named attributes outerStart and outerEnd, then we don't need to recalculate it at each call of updateMetadata. Also, we don't need to reassign leadingOffset and trailingOffset since the outer bounds are static.

This approach was profiled and there is a small improvement in the performance. I also appreciate the improvement in the simplicity of the code.

@Janther Janther requested a review from fvictorio February 1, 2026 14:39
@Janther Janther changed the title avoid reassigning the same values when we know nothing changes small tweak to the SlangNode class Feb 7, 2026
@Janther Janther merged commit 6ad71d8 into main Feb 8, 2026
7 checks passed
@Janther Janther deleted the small-improvement branch February 8, 2026 13:09
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