Hacker News new | ask | show | jobs
by TheLoneWolfling 4055 days ago
Can this particular case not be solved by adding a constructor that doesn't compress the string?

Edit: "There are no plans to add any new public APIs or other interfaces.". :(

1 comments

> Can this particular case not be solved by adding a constructor that doesn't compress the string?

Presumably if you use one of the byte[] constructors and the encoding is already in the compression format or something compatible then yes.

Whether you'll be able to do that depends on very much on how you implemented your IO. We're still seeing way to many String#substring in our traces after it become slow in 1.7.0_06. Some of them can be fixed easily, others not so much.

Agreed. The copy-on-substring behavior is a real pain, and I don't know if there's any workaround.
Not using String, eg. using CharBuffer (and #slice) or building your own. It's annoying and not always an option.
Yep, as you said, not always an option. No way to pass them to external things expecting strings, for one. Wouldn't be an issue, except that you can't extend strings.