Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Websocket buffers and async modes

On Jan 10, 2014, at 1:44, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:

> However, we would need to evaluate if iteratively calling charAt is efficient?  It may be better to just burn the memory and fetch the char array from the string.... pity there is no access to the internal string char[].

From my tests with multi-Gb json streaming, the .getChar() is way faster than memory allocation to a new char[] via getCharArray(), specially because I can also see no other alternative to get the bytes out. There is one exception in case multiple iterations are performed into the same data and the char array is relatively small to be cached on the CPU’s L1 though.


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


Back to the top