cadence icon indicating copy to clipboard operation
cadence copied to clipboard

memory metering for codec

Open robert-e-davidson3 opened this issue 2 years ago • 0 comments

I included metering for newly allocated Cadence values and types on decoding but there may be gaps. My biggest concern is that there may be unbounded values that are metered after allocation.

We may also want to meter the encoded bytes. Reasons not to include:

  1. It's smaller than the already-metered cadence Values and Types it represents.
  2. There's a fair amount of overhead in metering. That being said, there's an advantage: the default io.Writer the Encoder uses is a wrapper that keeps track of the number of encoded bytes, making it fairly easy to add metering every e.g. 1000 bytes.

robert-e-davidson3 avatar Sep 08 '22 17:09 robert-e-davidson3