Set the parameters on atom value buffer allocation and growth sizes. This is an important point for performance tuning, as many factors in the expected expression structure must be taken into account such as:
- Average size of atom values
- Variance in sizes of atom values
- Amount of memory that is tolerably ''wasted'' (allocated but not used)
The *ss* parameter specifies the initial size of all atom buffers. Ideally, this should be sufficiently large to capture MOST atom values, or at least close enough such that one growth is required. The *gs* parameter specifies the number of bytes to increase the buffer size by when space is exhausted. A safe choice for parameter sizes would be on the order of the average size for *ss*, and one standard deviation for *gs*. This ensures that 50% of all expressions are guaranteed to fit in the initial buffer, and rougly 80-90% will fit in one growth. If memory is not an issue, choosing ss to be the mean plus one standard deviation will capture 80-90% of expressions in the initial buffer, and a gs of one standard deviation will capture nearly all expressions.
Note: These parameters can be tuned at runtime as needs change, and they will be applied to all expressions and expression elements parsed after they are modified. They will not be applied retroactively to expressions that have already been parsed. |