So maybe toady could instead of trying to optimize the calculations during world gen try to make write some of the data in the ram memory to the hard disk (into some temporary file).
Unfortunately this won't help too much. It has already reached something like a "critical calculation duration" at crash.
What I mean is the following:
The Moment it crashes it already reached calculation times of about 10 Minutes per year. Dependent on the circumstances this will happen sooner or later. With all options set to max it reaches 10 minutes/year probably between year 240 and 260 from what I experienced so far. From this moment on it's not very far until it crashes. Maybe 20 years or so (read: 5 hours).
Now if this data was saved to the hard disc the calculation process would probably not crash. However, this would not get you anywhere anyways because at this point it takes maybe 50 additional years when the calculation time reaches 1h per year (additional 120 years to reach 24h per year). Probably it will even take longer as working with the harddrive will slow down the process additionally I guess.
So optimizing, cutting or "stretching" (e.g. calculation only for every 3 years, asuming that it didn't happen anything in this timespan) the calculations is the only way to go here I guess.
I am not a professional programmer though, so correct me if I oversaw something.