classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug(s) in java.lang.String


From: Artur Biesiadowski
Subject: Re: Bug(s) in java.lang.String
Date: Wed, 31 Jul 2002 23:14:24 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1a+) Gecko/20020714

Mark Wielaard wrote:

> Another solution would be to encode the values in CharData not as
> Strings but as actual char[] but that might be a lot less efficient
> (source code may explode I mean, it shouldn't matter for the class
> file).

Just the opposite IMHO. Source would be not longer, at least not much, class file on other hand would be a lot, lot larger. Instead of using utf8 for 16bits (2-3 bytes per entry), in bytecode it would equal to

aload_n
sipush index
sipush value
castore

which is 8 bytes. If we would use integers, it is more or less the same - instead of sipush value, ldc constant_index would be used, plus extra space in class file constants pool.

Artur




reply via email to

[Prev in Thread] Current Thread [Next in Thread]