Control table: Difference between revisions

Content deleted Content added
Line 84:
 
==Performance considerations==
AtEven firstthough sight,using the use ofa control tablestable wouldentails appearthe todevelopment addcost quiteand adeployment lotsize to a program's [[Computational overhead|overhead]], requiring, as it does,of an interpreter, process before the 'native' programming language statements are executed. This however is not always the case. Byby 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)|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 [[Control table#Quotations|quotations]] by [[Donald Knuth]], concerning tables and the efficiency of [[multiway branch]]ing in this article.