2016/03/18

16:02

Partially busy and distracting day today. For String compaction, I know of a way where I can have a compact form of Strings. Normally in ROM strings could be be referenced by a byte array of sorts for standard ASCII characters. I should note that some of these trade speed for memory and vice versa, however for lower memory usage the slight speed cost could be a nice gain.

16:02

There would be a mix of standard representation and dictionary types. The dictionary can be ASCII (if all 8-bit values are used) or UTF-16 (if there are these characters). The following types of string storage would be as follows:

Also when strings are initialized and copied for example from byte[] or char[], I can scan the string to see if it is possible to construct any of the above types. Although this would reduce speed, the input array and its copy could be removed.

Dictionaries can also be shared between strings, so if one string has a subset dictionary of another, they can share it.

16:51

Some constructor issues, UnsupportedEncodingException is a checked exception while some methods which use the default character set do not throw this exception at all (since the default is always valid anyway). I would suppose to avert this I could call a wrapper constructor of sorts which can magically initialize a string internally.

16:53

Also, I should probably clear out the squirreljme sub-package of stuff that does not need to be there. I am going to declare that said package should only contain stuff needed by the class library similar to com.sun and such.