The Common Case in Forth Programs

David P. Gregg, M. Anton Ertl, John T. Waldron · 2001

Identifying common features in Forth programs is important for those designing Forth machines and optimisers. In this paper we measure the behaviour of six large Forth programs and four small ones. We look at the ratio of user to system code, basic block lengths, common instructions, and common sequences of instructions. Our most important finding is that for most large programs, many (38.4%-- 47.6% statically and 21.8%--40.9% dynamically) basic blocks consist of only a single instruction, which hinders optimisation. We also show static measures of frequent instructions and sequences of instructions are more consistent across programs, and may be a better predictor of the behaviour of other programs than dynamic measures. 1 Motivation Perhaps the most important principle of modern computer architecture is to make the common case fast [HP96]. In deciding where to devote resources, favour the frequent case over the infrequent one. This is the idea behind RISC processors, virtual memory...

Read the paper · More papers on PaperTik