Hi all

Just checking if anyone would mind terribly if the AreaInfo inner class in TextLayoutManager were changed to use 'int' indices rather than 'short'.

AFAIK, this is the only reason we currently need to split up FOText instances larger than 32K characters. At the time I introduced this fix, I opted to split the FOText instances, since I was a bit concerned about a rise in memory consumption. Upon closer inspection, and some browsing around, this seems to have far less of an impact than I thought...

I did a quick test, allocating space for an array of 100.000 instances of:
- a wrapper around three short values (values Short.MAX_VALUE)
- a wrapper around three int values (values Integer.MAX_VALUE)

The results:
- 3 shorts -> 100.000 instances = (2200K - 800K) = 1600K
- 3 ints -> 100.000 instances = (2980K - 800K) = 2180K

The 800K is subtracted to account for the instance size (8 bytes * 100K).

So three ints do not take up 100% as much space (as I initially expected), but only roughly between 30% and 50%...


Opinions?

Cheers

Andreas

Reply via email to