Motivation: encoding large arrays of primitive types as TemplateData is fairly slow. The default encoding strategy for Data is to encode it as an array of bytes, which falls victim to that.
This PR avoids an accidental slowdown for the case where a model contains a Data field that gets encoded by default by the TemplateDataEncoder. (In one case, this change has reduced render times on a large page from ~3.75s to ~460ms in a Release build.)
In addition, encoding Data as a hex-encoded string arguably makes more sense than encoding it as an array of integers.
Motivation: encoding large arrays of primitive types as
TemplateData
is fairly slow. The default encoding strategy forData
is to encode it as an array of bytes, which falls victim to that.This PR avoids an accidental slowdown for the case where a model contains a
Data
field that gets encoded by default by theTemplateDataEncoder
. (In one case, this change has reduced render times on a large page from ~3.75s to ~460ms in a Release build.)In addition, encoding
Data
as a hex-encoded string arguably makes more sense than encoding it as an array of integers.