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

Encoding performance #98

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Encoding performance #98

merged 1 commit into from
Jun 19, 2024

Conversation

tenderlove
Copy link
Contributor

Default string literals to be encoded as ascii-8bit so we can avoid calling .b on string literals. Also change string literals to be mutable so we can avoid calling .dup on string literal buffers.

This should reduce method calls, but I didn't see any change in performance. I suspect that since the time is being dominated by String#<< this won't make much difference until we better support String#<< in YJIT

cc @nirvdrum

Default string literals to be encoded as `ascii-8bit` so we can avoid
calling `.b` on string literals. Also change string literals to be
mutable so we can avoid calling `.dup` on string literal buffers.
@maximecb
Copy link
Contributor

It's a bit surprising that time is so dominated by string concat that it dwarfs everything else so completely. Would be curious to see profiling data.

@maximecb maximecb merged commit 4978efb into Shopify:main Jun 19, 2024
1 check passed
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