Skip to content

Perfomance: avoid stack trace allocation when cancelling RectManager per-frame callbacks - #3411

Merged
Konstantin (terrakok) merged 1 commit into
jb-mainfrom
sk-perf
Sep 11, 2026
Merged

Konstantin (terrakok) merged 1 commit into
jb-mainfrom
sk-perf

Conversation

@terrakok

@terrakok Konstantin (terrakok) commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

When coroutines are being canceled, usually a CancellationException is created. And it means a new call stack of the error are being collected. It takes time.
My fix avoid that by using a prepared error instance. It is safe, because it is internal process and there is no need to provide a real call side for users.

Release Notes

Fixes - Multiple Platforms

  • Perfomance improvement: removed stack trace allocation when internal coroutines are cancelled on a hot path

@terrakok
Konstantin (terrakok) merged commit 2d09448 into jb-main Sep 11, 2026
19 of 20 checks passed
@terrakok
Konstantin (terrakok) deleted the sk-perf branch September 11, 2026 16:57
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