-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix tidy_bytes for JRuby #13919
Fix tidy_bytes for JRuby #13919
Conversation
@headius I wouldn't mind your review either. |
I wouldn't be surprised if this turns out to be measurably slower. I chose UTF-8 Mac because it's so nearly identical that I figured it should be pretty trivial to transcode, whereas UTF-16 is a completely different encoding. I don't have any numbers to back this hunch up, however, and even if it is slower, it may not make much of a difference in real cases. It should, in theory, work. I can't think of any case where a character would be representable in UTF-8 but not UTF-16 (or vice versa). Comment at the top of the method is in need of minor rewording too. |
I don't think it should be any slower. It will have a larger memory footprint, but seems better to get this working on JRuby than to save a few bytes. |
Should we merge this? |
Has anyone actually benchmarked it? We've all chipped away at this method Sent from my phone |
Here's a benchmark run on ruby 2.1.0p0. I don't show any appreciable difference. |
Awesome. Let's merge it! |
This will require a rebase with master as well |
The previous implementation was broken because JRuby (1.7.10) doesn't have a code converter for UTF-8 to UTF8-MAC.
@arunagw rebased. |
👍 from me too. |
The previous implementation was broken because JRuby (1.7.10) doesn't
have a code converter for UTF-8 to UTF8-MAC.