|
[
Permlink
| « Hide
]
Andrew John Hughes added a comment - 30/Oct/07 04:19 PM
Primarily, it is worth looking at whether GCJ's StringBuffer could be merged into Classpath allowing general access to this code.
Most of this work is done. We just need to create a further internal class that doesn't copy on toString() and use that throughout the codebase.
Cool, how do we do this? Is it a JikesRVMHelpers/Support call that we need? I'm not sure what the internal class will do.
It's an internal GNU Classpath class, not a VM thing although JikesRVM can of course make use of it internally too (and probably should). It will be in the gnu.classpath namespace.
This class now exists as gnu.classpath.CPStringBuffer. It can be used just like the other string buffers, but is not thread-safe and does not copy the character data on toString() or substring().
minor point, if its not thread-safe should it be called CPStringBuilder?
Yeah I thought that too; I'll change it because I'm typing CPStringBuilder too...
neat, are you putting this change through Classpath, it'll be great to lower the StringBuffer/Builder overhead.. another thing to look at is the default size of the buffer.. for a CPStringThingy it needed default to 16
The patch went into Classpath at the end of last week and I've ported this fixes over to JikesRVM, with appropriate VM interface changes today.
Revision: 13988 Log Message: Modified Paths: Added Paths: More to follow. Needs some more patches porting from CP before the release.
Note that, long term, we could ideally optimise the instance creation via VMCPStringBuilder. CACAO now does this.
Andrew said on the list that this either had to be completed or the partial version that is in now backed out before the next release, so raising priority to blocker.
With revision 14173, this is now at a state where it can be shipped in the next release.
There are still patches to be done, but I'd rather not risk introducing bugs before the release, so I'll close this bug and add a new one for full support in 2.9.4.
|
||||||||||||||||||||||||||||||||||||||||||||