Description
Why not just create a constant macro for it? It would be be more space efficient to have a constant macro (even if it has a multi-byte address) than it is to convert a symbol using `make_string`.
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 if make_string
is not one of the first 64 macros in the default module, then it will require 2 bytes to encode the macro address.
03 // macro `make_string`, assuming it can be invoked using a one-byte user-space address
01 // AEB - one expression present
E1 XX // Symbol with 1-byte SID
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)