...
The actual work of this extension is done in getRGB. This is the speed critical routine. Make every effort to optimize this function. Do not allocate memory in it. Avoid any OS and/or SDK function calls in this critical routine. Most of the memory can be pre-allocated in initializeForRendering. If you want to access the global scene pointer, store it inĀ initializeForRendering and use it later. This can save a huge amount of time.
...