Also worth noting is that the JDK recently introduced "compact
strings", which allows for storage and creation of strings in 8-bit
encoding under some circumstances. So String might actually be an
okay long term choice in the end after all.
References:
- JEP 254
https://openjdk.java.net/jeps/254
-
https://bugs.openjdk.java.net/browse/JDK-8054307
-
https://dzone.com/articles/compact-strings-in-java-9
On Tue, Apr 23, 2019 at 11:43 PM Stuart Douglas <sdouglas(a)redhat.com> wrote:
>
> This is one of the things I am not 100% sure about. I think CharSequence is probably
the way to go, but I need to investigate the performance of the various options.
>
> With the Servlet API end users need to use String anyway, so if we made AsciiString
part of the API we may end up with worse Servlet performance but better native handler
performance, so there will probably be a trade off somewhere.
>
> Stuart
>
> On Tue, Apr 23, 2019 at 10:42 PM Carter Kozak <ckozak(a)ckozak.net> wrote:
>>
>> Greetings,
>>
>> I'm curious what the plan is for HttpString in undertow 3.x, since this will
potentially be the most frequent migration for components which don't implement custom
xnio mechanisms. At the moment, the 3.x branch has replaced most uses of HttpString with
String, however netty provides a similar AsciiString type which may provide similar
performance characteristics to HttpString. Have we considered using the Netty type
directly where HttpString is currently used, or using CharSequence instead of string since
AsciiString already implements CharSequence, and HttpString may be updated to support it?
Based on UNDERTOW-147 [1] I suppose there's some question as to whether or not a
non-string type is desirable for Servlet uses.
>>
>> Thanks,
>> Carter
>>
>> 1.
https://issues.jboss.org/browse/UNDERTOW-147
>> _______________________________________________
>> undertow-dev mailing list
>> undertow-dev(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/undertow-dev
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/undertow-dev
--
- DML