Control Table - Performance Considerations

Performance Considerations

At first sight, the use of control tables would appear to add quite a lot to a program's overhead, requiring, as it does, an interpreter process before the 'native' programming language statements are executed. This however is not always the case. By separating (or 'encapsulating') the executable coding from the logic, as expressed in the table, it can be more readily targeted to perform its function most efficiently. This may be experienced most obviously in a spreadsheet application - where the underlying spreadsheet software transparently converts complex logical 'formulae' in the most efficient manner it is able, in order to display its results.

The examples below have been chosen partly to illustrate potential performance gains that may not only compensate significantly for the additional tier of abstraction, but also improve upon - what otherwise might have been - less efficient, less maintainable and lengthier code. Although the examples given are for a 'low level' assembly language and for the C language, it can be seen, in both cases, that very few lines of code are required to implement the control table approach and yet can achieve very significant constant time performance improvements, reduce repetitive source coding and aid clarity, as compared with verbose conventional program language constructs. See also the quotationsby Donald Knuth, concerning tables and the efficiency of multiway branching in this article.

Read more about this topic:  Control Table

Famous quotes containing the word performance:

    Nobody can misunderstand a boy like his own mother.... Mothers at present can bring children into the world, but this performance is apt to mark the end of their capacities. They can’t even attend to the elementary animal requirements of their offspring. It is quite surprising how many children survive in spite of their mothers.
    Norman Douglas (1868–1952)