Forum Discussion
I'm pretty new to this (been working on my 1st project for about a week, now) but I've started just making all of my classes components that extend Node. Things seem to play nicer that way. š¤·āāļø
Interesting re: doing everything as a Node. Is that the recommended approach? Is anyone aware of the performance overhead from using Nodes vs plain objects (I assume there is some)?
- sanity-check2 years agoRoku Guru
Kind of... The docs mention AA vs Nodes here:
In reality creating a node takes an order of magnitude or two longer than creating an AA so depending on how much you're passing them around the overall perf hit might or might not balance out.
My thinking, though, is that most (all?) of the big objects we're passing around are destined for RowLists etc anyway, in which case they need to be turned into ContentNode trees eventually - so I just do it early. For smaller bits of data it doesn't matter if it takes 8ms to create a single AA or 80ms to create a single Node, if it's happening once every few minutes rather than 200 times in a loop.