Merged
Conversation
To improve performance and specify fields explicitly. Ref: https://docs.ruby-lang.org/en/3.2/OpenStruct.html#class-OpenStruct-label-Caveats
ioquatix
approved these changes
Jan 8, 2023
Member
|
Thanks, this looks good to me. |
Earlopain
added a commit
to Earlopain/rack
that referenced
this pull request
Apr 2, 2024
OpenStruct usage was removed in rack#2004 but this was missed. In Ruby 3.5 this require would trigger a warning
jeremyevans
pushed a commit
that referenced
this pull request
Apr 2, 2024
OpenStruct usage was removed in #2004 but this was missed. In Ruby 3.5 this require would trigger a warning
Earlopain
pushed a commit
to Earlopain/rack
that referenced
this pull request
May 23, 2025
To improve performance and specify fields explicitly.
Earlopain
added a commit
to Earlopain/rack
that referenced
this pull request
May 23, 2025
OpenStruct usage was removed in rack#2004 but this was missed. In Ruby 3.5 this require would trigger a warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using OpenStruct is not recommended from a performance or bug-prone standpoint.
Ref: https://docs.ruby-lang.org/en/3.2/OpenStruct.html#class-OpenStruct-label-Caveats
Performance
Add
Frameclass by Struct, and replace https://github.com/rack/rack/blob/v3.0.3/lib/rack/show_exceptions.rb#L81-L103 with the following code.Add the following tests to
test/spec_show_exceptions.rb, then run it.The result in my environment (Ruby 3.2.0 on macOS Big Sur), is the following.
A backtrace of about 100 lines is not dramatically slow to begin with, but it is effective.