tuxji commented on pull request #674:
URL: https://github.com/apache/daffodil/pull/674#issuecomment-967395784


   Some questions for clarification:
   
   1.   What is the pitfall of just taking a snapshot of variables’ values like 
other state and restoring the snapshot when resetting back to the PoU?  A 
snapshot copies variables’ values at a certain point in time and restoring the 
snapshot resets variables back to their snapshotted values.  What does a 
variable’s mutability have to do with that, that is, why would snapshotting 
variables be more complicated than snapshotting other state?  I do understand 
the overhead of copying all variables’ values in every snapshot and resetting 
them (likely back to the same values) when restoring snapshots. 
   2.   Adding copy-on-write behavior to variables sounds like an attempt to 
optimize away some of the overhead on the assumption that variables change 
values infrequently.  Do you have any range of numbers (even ballpark guesses) 
for how many variables might exist during a parse (from zero to 20?) and how 
many times variables really change values during a parse (from zero to 1000 
times)?
   
   My suggestion is to replace the broken code (which makes assumption) with 
simple code that is obviously correct in behavior while measuring performance 
before and after.  When you are satisfied the code works correctly, then you 
can look for ways to use copy-on-write, caches, etc., to speed up performance.
   


-- 
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]


Reply via email to