Skip to content

Optimistic error handling in IRProcessor#16

Open
konovalov-aleks wants to merge 1 commit into
yandex:mainfrom
konovalov-aleks:optimistic-ir-processor-error-handling
Open

Optimistic error handling in IRProcessor#16
konovalov-aleks wants to merge 1 commit into
yandex:mainfrom
konovalov-aleks:optimistic-ir-processor-error-handling

Conversation

@konovalov-aleks

@konovalov-aleks konovalov-aleks commented Jul 10, 2026

Copy link
Copy Markdown

I noticed that IRProcessor builds error messages every time even when validation succeeds. This simple patch introduces a small compiler optimization: message parts are passed to Ensure separately and combined only on failure, avoiding unnecessary allocations, string concatenations, and integer conversions on the successful path.

I also added tests covering IRProcessor validation errors and their diagnostics.

Thank you for the great project!

Previously, IRProcessor built error messages even when validation
succeeded. With this patch, message parts are passed to Ensure
separately and combined only on failure, avoiding unnecessary
allocations, string concatenations, and integer conversions on the
successful path.

Tests have been added to cover IRProcessor validation errors and their
diagnostics.
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