Metal 7.0.0
This release introduces lazy input reading to reduce heap usage and improve scalability and performance. Lazy IO involves the following changes:
- Data read by
Def
andUntil
tokens is no longer cached, so it is only read when referenced (e.g., by a comparison expression or by requesting the data throughgetValue()
after a parse). - The
Len
(length of a value),Cat
(concatenation of values) andBytes
(splitting values) expressions are also lazy, so using these does not automatically cause a read. - The
Nod
token has been removed since large pieces of data that are unused can now be safely described usingDef
. The shorthand remains but maps toDef
.
There has also been a cleanup of the API:
- All remaining uses of integers describing offsets and lengths have been converted to
BigInteger
. The remaining limitation is that once a value is read it is stored in a Java byte array, which means its size is limited to 2GB. - The
Environment
has been renamed toParseState
andCallbacks
has been moved out of it. A newEnvironment
class has been introduced that aggregates all inputs to a parse (Scope
,ParseState
,Callbacks
andEncoding
). ParseState
is now passed in toValueExpression.eval()
instead of only theParseGraph
. As a resultCURRENT_OFFSET
now works correctly again, also aroundSub
andTie
tokens.
Some fixes/changes:
- Negative offsets are no longer attempted to be handled. They either cause a fail (during parse) or throw an exception (when passed in directly).
- JDK9 is now supported, but Metal itself is still Java 8 compatible.
- FindBugs no longer incorrectly reports a problem with
equals()
.
For a more detailed description, please see the 7.0.0 Milestone.