Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YJIT: optimized codegen for String#length #9543

Merged
merged 1 commit into from Jan 15, 2024

Conversation

maximecb
Copy link
Contributor

Minor optimization for programs doing string processing.

@XrXr feel free to tell me if my assumptions wrt this function not needing special setup and always returning a fixnum on 64-bit machines are wrong.

Minor optimization for programs doing string processing.
@maximecb maximecb self-assigned this Jan 15, 2024
@matzbot matzbot requested a review from a team January 15, 2024 21:37
Copy link
Member

@XrXr XrXr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. It handles broken encoding without raising exceptions (see spec/ruby/core/string/shared/length.rb). And it's <= bytesize so we carry over the fixnum assumption.

@maximecb maximecb merged commit 6a1bf4c into ruby:master Jan 15, 2024
97 checks passed
@maximecb maximecb deleted the yjit_str_length branch January 15, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants