Short:        How to optimize in E
Author:       misha@femina.com.pl (Michal Durys)
Uploader:     misha femina com pl (Michal Durys)
Type:         dev/e
Version:      1.0 (30.5.99)
Architecture: m68k-amigaos
Keywords:     e optimization misha polska poland

              .---------------------------.
-------------(         DESCRIPTION         )
              `---------------------------'
This package is a result of my adventures with code optimization in E. I
want my programs to be as fast as it's only possible. To achieve this I
did many tests. Now I decided to release the results to public.

These tests are fairly simple but very meaningful. Eg. did you know that

FOR i:=0 TO LOOP_COUNTER DO something

is almost ten times faster than

FOR i:=0 TO LOOP_COUNTER
  something
ENDFOR

Just look at the included results and you will discover more intersting
facts. All timings were done on my A1200 equipped with Apollo 1240/040
(overclocked) turbo board.

But remember that the tests are not fully reliable, for example edit
increase.e and remove some tests like this:

PROC main()
  test({addone},   'x:=x+1',      LOTS_OF_TIMES) ; x:=0
->  test({addql},    'ADDQ.L #1,x', LOTS_OF_TIMES) ; x:=0
->  test({addqb},    'ADDQ.B #1,x', LOTS_OF_TIMES) ; x:=0
  test({increase}, 'INC x',       LOTS_OF_TIMES) ; x:=0
ENDPROC

Compile the program and when you execute it you will get different results.
I was not able to track down the reason. If you can fix it be my guest.

              .---------------------------.
-------------(         DISTRIBUTION        )
              `---------------------------'
This package is public domain.