|
From: Roger H. <rog...@mi...> - 2004-04-02 13:38:22
|
Here is a stand alone optimisation which is part of the larger group of optimisations which I have submitted for approval. This one stands on its own merit and I would like permission to incorporate it into the official cvs source. It has been incorporated into the issued version of Microspot Interiors so it does not seem to cause any problems. The changes are totally within E3View.c In the current cvs source, TQ3ViewData has a field viewState which is used to switch into the appropriate piece of code whenever an object is submitted, including objects within groups in retained mode. .My version adds a pair of pointers to functions, one for immediate mode and one for retained mode. Whenever viewState gets changed then so do the two function pointers. e3view_submit_object disappears entirely and E3View_SubmitRetained and E3View_SubmitImmediate become simply calls to the appropriate function pointer. All the tests at the bottom of E3View_SubmitRetained are rolled into the routines which get vectored to. There are two for each value of viewState, including the 'Error' and 'BadMode' cases. As the routines know exactly what mode they are in they are quite simple, though they still have to check for nil pointers etc. The benefits are faster execution, a simpler stack crawl when you are debugging. The only slight downside is that e3view_submit_begin is a little bit bigger and that there is no central submit routine where code could be placed. Anything truly common could be put into both the immediate and retained mode submit routines, though I think that the code is now stable enough that this would be unlikely. Can I go ahead with this? Roger Holmes. |