0
$\begingroup$

Two scenarios:

  1. Function is called and data is computed and returned.
  2. Data is saved in variable, updated when required, data is retrieved from variable.

So I was wondering in what kind of scenarios one would be beneficial over the other?

$\endgroup$
2
  • $\begingroup$ For starters, how long does it take to compute the data? How often is that done, where is it used and by how many processes? Is there simultaneous access? Your second point brings us to databases and database theory. $\endgroup$
    – Juho
    Mar 17 at 11:45
  • 1
    $\begingroup$ Space–time tradeoff. $\endgroup$
    – Pål GD
    Mar 17 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.