How to control if const or non const Getter is called?

Started by
11 comments, last by JoeJ 1 year, 7 months ago

In that case you don't need copies of everything, just an indicator of where things have changed. A common approach in many systems — from databases to word processing documents — is to maintain a small table or structure with the modifications. In word processing it's the difference between a quick save and a slow save, the slow save writes everything, the fast save writes the small table of modified elements. Databases do it with pages of data appended to the end.

I've done similar in games before with large pools of data. In one specific scenario we had the large sorted pool of data and the small unsorted pool of modifications. It added a small amount of complexity to first hit the main pool which is fast, and then do a quick scan of the small dirty pool, but overall was much faster than modifying the large pool with each small modification. Eventually when the small pool hit critical mass we'd merge the two, a costly processing operation but done at a time when we could afford the computational hit.

Advertisement

frob said:
In that case you don't need copies of everything, just an indicator of where things have changed.

I see, and haven't thought about such things. Makes sense. Thanks!

This topic is closed to new replies.

Advertisement