Performance question? Copy data through multiple child templates layers or read parent data directly

I am currently coping a common dataset through a number of hierarchical template layers. And was wondering if the data is being duplicated or just additional references created? If duplicates are made would it make sense just to reference parent template instance data instead ? e.g. view.parentView.data…

Thanks in advance,
Luke

I think it’s the usual JS rule: If it’s a primitive, it gets copied, if it’s an object, it makes a reference.

The real performance hogs are Blaze’s template creation and rendering, compared to that, some duplicated variables shouldn’t matter at all. Do whatever you find is easiest to work with I think.

1 Like