Skip to content

perf: make schema.formatted lazy to avoid eager tree walk#296

Merged
ronaldtse merged 1 commit intomainfrom
perf-v2
Apr 3, 2026
Merged

perf: make schema.formatted lazy to avoid eager tree walk#296
ronaldtse merged 1 commit intomainfrom
perf-v2

Conversation

@ronaldtse
Copy link
Copy Markdown
Contributor

Summary

  • Changed formatted from eager attribute to lazy method in Schema class
  • Removed 4 eager schema.formatted = schema.to_s(no_remarks: true) assignments from parser.rb
  • Avoids full tree walk per schema parse — only computed when accessed

Test plan

  • bundle exec rspec spec/expressir — 1342 tests pass
  • bundle exec rubocop — no offenses
  • CI: all checks pass

- Changed `formatted` from eager attribute to lazy method
- Removed 4 eager `schema.formatted = schema.to_s(no_remarks: true)` assignments from parser.rb
- Avoids full tree walk per schema parse — only computed when accessed
@ronaldtse ronaldtse merged commit ed5a252 into main Apr 3, 2026
14 checks passed
@ronaldtse ronaldtse deleted the perf-v2 branch April 3, 2026 08:29
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