Create custom macros for Macroize text patterns instead of invoking make_string
directly
#1006
Labels
ion11
Related to Ion 1.1
make_string
directly
#1006
In the best case, it requires a minimum of 4 bytes to invoke
make_string
with a single SID. If there are more than 255 symbols, then you could have a 2-byte SID here, and ifmake_string
is not one of the first 64 macros in the default module, then it will require 2 bytes to encode the macro address.Whereas constant macros up to (approximately) address 1MM can always be invoked using 3 or fewer bytes.
The overhead of the macro definition itself is about 4-5 bytes (1 byte to start s-expression, 2 bytes for
macro
symbol, 1 byte for empty signature, payload, optional 1 byte to end macro definition if using delimited sexp), so the break-even point is 5 usages or fewer in the worst case. If e.g. the constant macro is encoded with a 2 byte macro address and the SID would be 2 bytes, the break-even point is 2 usages.Originally posted by @popematt in #990 (comment)
The text was updated successfully, but these errors were encountered: