cws/cw05.tex
changeset 234 c51305a2217f
parent 233 38ea26f227af
child 237 db4d2fcd8063
equal deleted inserted replaced
233:38ea26f227af 234:c51305a2217f
   461   As you can see, the compiler bets on saving so much time on the
   461   As you can see, the compiler bets on saving so much time on the
   462   \pcode{+B} and \pcode{+M} steps so that the optimisations is
   462   \pcode{+B} and \pcode{+M} steps so that the optimisations is
   463   worthwhile overall (of course for the \pcode{>A}'s and so on, the compiler incurs a
   463   worthwhile overall (of course for the \pcode{>A}'s and so on, the compiler incurs a
   464   penalty). Luckily, after you have performed all
   464   penalty). Luckily, after you have performed all
   465   optimisations in (5) - (7), you can expect that the
   465   optimisations in (5) - (7), you can expect that the
   466   \pcode{benchmark.bf} program runs four to five times faster.\hfill{[2 Marks]}
   466   \pcode{benchmark.bf} program runs four to five times faster.
       
   467   You can also test whether your compiler produces the correct result
       
   468   by for example testing
       
   469 
       
   470   \begin{center}
       
   471   \pcode{run(load_bff("sierpinski.bf")) == run4(load_bff("sierpinski.bf"))}
       
   472   \end{center}
       
   473 
       
   474   which should return true for all the different compiler stages. \\ 
       
   475   \mbox{}\hfill{[2 Marks]}
   467 \end{itemize}  
   476 \end{itemize}  
   468 
   477 
   469 \end{document}
   478 \end{document}
   470 
   479 
   471 
   480