Replies: 1 comment
-
I didn't quite follow the second paragraph.. However, for the purpose of footprint calculation, would defining a string as a container of characters suffice or is there more you'd like to change? So a string with 1000 characters would equal a footprint of 1 + 1000. Maybe with a factor if that skews things too much (but not sure that matters or there is a good choice). ..re-reading: Oh, I think you just mean using a factor of I guess that sounds good. |
Beta Was this translation helpful? Give feedback.
-
Currently we define a value "footprint" (per
val_footprint
et al.) as "the number of objects the value contains either directly or indirectly", being careful to flag that the values are meant to be comparable but are not promised to be exact. I'd like to either refine this definition or introduce a related one that factors in the size of variable-sized atomic objects. In particular, I'd like an object that contains a string with 1,000 characters to be viewed as having a significantly larger "footprint" than one whose string has say 10 characters.I'm inclined to do this directly by changing just what "footprint" means (in particular, under the hood treating every
N
string characters as an "object" in the total count, whereN
equates tosizeof Val
say). This seems harmless enough given I really doubt anyone is currently relying on footprints being specifically number-of-objects.Thotz?
Beta Was this translation helpful? Give feedback.
All reactions