-
-
Notifications
You must be signed in to change notification settings - Fork 922
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
Truffle encoding #2765
Truffle encoding #2765
Conversation
…ell. While we're using Rubinius's encoding subsystem substantially, we still delegate to JRuby methods in various places. JRuby's runtime is unaware of any encoding values set via Rubinius and as a result, we can generate strings with incorrect encodings if we don't take care to update JRuby's runtime as well.
…onverterPrimitiveNodes.
…ava-based ones if they exist.
…code! from Rubinius. This commit also fixes several issues in our encoding implementation that surfaced through greater usage of Encoding and Encoding::Converter.
null, | ||
getContext().makeString("filesystem"), | ||
indexLookup(encodings, filesystemEncoding) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create some kind of createTuple
helper here?
self.default_internal_jruby = enc | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this
|
@paths = {} | ||
@load_cache = true | ||
@cache_valid = false | ||
@transcoders_count = TranscodingMap.size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah here, I see. Could be worth to make a private class method setup
that initialize to non-trivial values. But probably good enough for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to avoid modifying their source altogether since it would make future updates easier. But I'm open to other options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is good for now I think.
…'s an internal API call.
Startup suffers quite a bit though ...
|
Wow! Normally I'd say not to worry about it as it's not peak performance - but 10s is a bit insane. We risk people trying Truffle out getting a very bad impression. It might be the hash operations - we never resize remember - so I'll see if I can optimise the methods and specialisations used in |
It looks like that converter_paths load is to blame after all. I'll work on fixing that now. While big, it's a bit disconcerting that interpreted hash updates are that slow. That might warrant additional investigation. |
Just parsing that file might be slow, Rbx precompiles to .rbc so that might motivate their approach. |
This is a bit large and I had to do some interesting things to init Rubinius properly. I'd appreciate another set of eyes before I merge it. @chrisseaton @eregon