From version 4.1.0.0, the results of a simulation are not stored in the database but in a binary file. This greatly reduces memory requirements and improves the performance.
The results are written as a stream of data. Once written, they are not modified.
The storage format is based on this principle.
Each record is in the form of a mark identifying the type (and, possibly, the format version) of the result, followed by the result itself.
The records are written one after the other. A specific routine must be written to read and to write each type of result.
The mark is a long holding 8 characters. The characters must be encoded using BitUtil.toMark and decoded using BitUtil.fromMark.
Structure:
The simulations using this format are six times faster and, more importantly, use much less memory enabling larger simulations to be carried out in an acceptable timeframe as the Java Virtual Machine uses much less processor time.
With this structure, new types of result can be added easily. A generic reader switches to the appropriate reader function depending on the mark at the start of the record.
Each object will have its own code for the writing the data required to be stored, putting its own mark before recording the data.
This mechanism uses memory-mapped files and Windows is still unable to address a memory-mapped file correctly. Furthermore, with the use of sparse arrays and massive datasets, the arrays are now stored in text files in storage optimized for arrays.