Skip to content

Metal 7.0.0

Compare
Choose a tag to compare
@jvdb jvdb released this 15 Nov 08:13
· 476 commits to master since this release

This release introduces lazy input reading to reduce heap usage and improve scalability and performance. Lazy IO involves the following changes:

  1. Data read by Def and Until tokens is no longer cached, so it is only read when referenced (e.g., by a comparison expression or by requesting the data through getValue() after a parse).
  2. The Len (length of a value), Cat (concatenation of values) and Bytes (splitting values) expressions are also lazy, so using these does not automatically cause a read.
  3. The Nod token has been removed since large pieces of data that are unused can now be safely described using Def. The shorthand remains but maps to Def.

There has also been a cleanup of the API:

  1. 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.
  2. The Environment has been renamed to ParseState and Callbacks has been moved out of it. A new Environment class has been introduced that aggregates all inputs to a parse (Scope, ParseState, Callbacks and Encoding).
  3. ParseState is now passed in to ValueExpression.eval() instead of only the ParseGraph. As a result CURRENT_OFFSET now works correctly again, also around Sub and Tie tokens.

Some fixes/changes:

  1. Negative offsets are no longer attempted to be handled. They either cause a fail (during parse) or throw an exception (when passed in directly).
  2. JDK9 is now supported, but Metal itself is still Java 8 compatible.
  3. FindBugs no longer incorrectly reports a problem with equals().

For a more detailed description, please see the 7.0.0 Milestone.