# Optimisation logbook

A list of optimisation decisions and their effect on performances.

## 2011/09/02

- [885] [886] [888] Started importing Ryan Sammartino's PS3 trigonometry library in the core ().
- [890] Do the Taylor series on
`x / π`

instead of`x`

: results in a measurable speed increase in`sin()`

- 2% with ppu-lv2-g++ 4.1.1 on a PS3
- almost 1% with SNC 360.1 on a PS3
- 30% with g++ 4.5.2 on mingw32 running on a Core2Quad

- [891] Do the Taylor series in two steps, for better pipelining at the cost of one extra multiplication: a notable speed increase in
`sin()`

- 11% with ppu-lv2-g++ 4.1.1 on a PS3
- 2% with SNC 360.1 on a PS3
- 7% with g++ 4.5.2 on mingw32 running on a Core2Quad

Note: there is currently no way to build all the engine using SNC. However, individual files can be built using a command along the following one:

touch trig.cpp ps3ppusnc.exe -c trig.cpp -O3 -Xreorder=1 -Xfastmath=1 -o liblol_a-trig.o -I. make

## 2011/10/11

- [1016] Encode reals using
`uint32_t`

instead of`uint16_t`

.- additions are 2.1 times faster
- multiplications are 2.4 times faster
- divisions are 2.4 times faster (actually fixed in [1017])

## 2011/10/12

- [1020] Replace divisions with multiplications in Taylor series expansions: instead of
`x+=a/b`

we use`x=bx+a`

and divide the end result by`b`

- sin() is 3.8 times faster
- exp() is 4.1 times faster

Last modified 7 years ago
Last modified on Oct 12, 2011, 3:19:43 AM