I've kicked the idea around, but the truth is that Java's String is pretty blazing fast. Sticking with a normal String also leaves open the option to support unicode out-of-the-box, which we wouldn't get with a byte[]. There's a bit of a mismatch between how Ruby strings work and how Java's String works, but I think the benefits we get from using String outweigh any gains we'd see from replacing it.

On 6/6/06, Evan Buswell <[EMAIL PROTECTED]> wrote:
Have there been any thoughts of implementing RubyString as byte[]
instead of String?  Or maybe java.nio.ByteBuffer?

This fits better with the Ruby paradigm of what a String *is*, saves
memory (since RubyStrings are binary data, there is one wasted byte for
every byte of real data in a Java string), would save a conversion on IO
calls, etc.  Also, this would make that creepy feeling in the back of my
head go away when I know Java Strings are containing somewhat binary
data :-)

Its possible this ends up being actually *less* of a pain to do stuff
with in the long run from the issues one would avoid.

Evan

--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com
_______________________________________________
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to