I've got a class member function that generates a large list and puts it into a private member variable so it can be accessed through a getter. The generation of this list is a rather intensive process (in my testing it's just under a second, but with larger datasets I expect it to take much longer), involving lots of recursion and going back and forth over sublists. This function is public so that the list can be re-generated at any time, whether or not 'natural' initialization has occurred yet.
Given all this, is it better to set things up so that the list is generated when the object is constructed, or to make it generate the list when the getter function is called if the list has not been generated yet?
Also, I should add that we assume that the list is up-to-date and doesn't need to be changed until the user specifically tells us to refresh it.