stevedlawrence commented on pull request #674: URL: https://github.com/apache/daffodil/pull/674#issuecomment-967454410
1. I think its really just about potential overhead. Variables really don't change all that often, and so copying the entire variable state every time we enter a point of uncertainty might have some noticeable overhead. I'm not sure if that's why we have this prior state stuff or not, but I would guess that the reason for being different than the rest of the PoU stuff. 2. Most schemas don't define variables at all, but there are four predefined variables that will always exist: [7.7.1.2 Predefined Variabls](https://daffodil.apache.org/docs/dfdl/#_Toc349042676). So there is a minimum of four variables. Though I imagine max used is still fairly small, probably in the range of a dozen or so. So a fully copy every PoU might not be terrible. That said, we recently added `newVarialbeInstance`, which makes variables much more useful--I think I've already seen in increase in variables since this was added. That said, I'd gust most variables change pretty rarely. They're set once, read a few times, and then that's it. But that's just a guess. I've actually already implemented the copy-on-write approach, we were kindof already doing something similar, it was just a matter change storeing copies in separately from the variable instances. Though I am interested if there is a performance benefit. It would be much simpler to just copy the whole thing, and it shouldn't be too much effort to change it to the simpler copy-everything-on-PoU and see the difference. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
