Re: Creating a byte[] of long size
On 09-07-2010 13:46, Lew wrote:
Boris Punk wrote:
Is it not as simple as assigning int as 64 bit and long as 128 bit in newer
versions
That depends. For whom would it be simple, and for whom not?
How much legacy code are you willing to break?
What about folks who suddenly experience performance degradation
because their existing structures suddenly don't fit in on-chip cache
any more, whose programs are suddenly twice as large, and for whom
memory accesses overall suddenly take twice as long?
Whether they need the extra capacity or not?
That type of optimizations would break anyway over time.
Code lives a lot longer than hardware.
It is not realistic to assume identical or almost identical
performance characteristics over the lifetime of code.
One of the reasons why micro optimization is rather pointless.
Even today, as pointed out upthread, Java is perfectly capable of
handling data structures that exceed 2 GB in size, just not in a
single array or int-based structure (or in 32-bit mode). You have to
go with multi-dimensional arrays or Collection<Collection> types of
structures, but they will work.
I predict that even when the need for multi-gigabyte arrays becomes
widely acknowledged that the actual use cases for them will remain
quite specialized. I venture to say further that the OP doesn't need
one yet.
I agree with that one.
Such huge arrays seems mostly a scientific computing wish.
Arne