On Sunday 22 August 2010 18:22:56 Lance Corrimal wrote: > related line of thought: > > > how much faster could the viewer be if every single of these "do not > change this ever" settings was replaced with a #define in a central > include file? > or in other words, what is the cpu cycle penalty for a > SavedSettings.getBOOL() and the others? >
Please, no #defines... You can cache the value of a settings and rely on callback magic to change the cached var when the setting has changed: #include "llcontrol.h" (or llviewercontrol.h in 1.x, with a slightly different constructor) static LLCachedControl<bool> cached_foo(gSavedSettings, "SettingFoo"); This way you can use cached_foo to get the value of the setting in methods that get called often, without doing a lookup in a big std::map. > > bye, > LC > -- Thickbrick _______________________________________________ Policies and (un)subscribe information available here: http://wiki.secondlife.com/wiki/OpenSource-Dev Please read the policies before posting to keep unmoderated posting privileges