|
From: Roger H. <rog...@mi...> - 2007-02-26 19:41:54
|
> How about this: > > e3group_display_metahandler returns the same routine for the four > instances > case kQ3XMethodTypeObjectSubmitBounds: > case kQ3XMethodTypeObjectSubmitPick: > case kQ3XMethodTypeObjectSubmitRender: > case kQ3XMethodTypeObjectSubmitWrite: > > These could be four separate routines, call them > e3group_display_submit_contents_Bounds > e3group_display_submit_contents_Pick > e3group_display_submit_contents_Render > e3group_display_submit_contents_Write > These would know the view mode and so would > not have to get it or switch on it. Sorry about replying to my own e-mails, but in the same way as above, e3group_metahandler returns the same routine for three instances case kQ3XMethodTypeObjectSubmitBounds: case kQ3XMethodTypeObjectSubmitPick: case kQ3XMethodTypeObjectSubmitRender: These can also be usefully separated. I did not say in the original email, but the separated instances can then be optimised by removing the checks on the mode, and eliminating the stuff which is not required, which makes the routines smaller and hence more likely to remain in the cache as well as not executing so many instructions. One other thing I noticed, E3Bit_IsSet would probably be very slightly quicker coded as ((TQ3Boolean) (((_bf) & (_b)) != 0)) rather than ((TQ3Boolean) (((_bf) & (_b)) == (_b))) Alternatively, just use E3Bit_AnySet instead, and maybe rename E3Bit_IsSet to be E3Bit_AllSet as there nothing stopping you passing the first parameter as multiple bits. Roger. |