ECU tunning from the factory is very conservative, they tried to tune the ECU for every possible situation like extreme heat, low octane fuel, high loads and then detune it one more step to be safe.
On a Honda Rice Rockets for instance, during a dyno pull with the lamba (O2 sensor) installed. It goes rich as you reach the last 2000rpm before redline. This is done to protect the engine from severe detonation at WOT which the ECU is on open loop mode. By tinkering with the ECU we were able to get another 5-7hp just by leaning the top end.
During part throttle and the ECU is on close loop, it is monitoring the O2 sensor, throttle position, RPM, ignition, MAF, coolant temp, knock sensor etc. If you are using 91 oct. fuel the ECU will advance the ignition timing to take advantage for the slower burning fuel. Wheras it will slightly retard ignition for 87 oct fuel. On more advanced engines there is a knock sensor for every cylinder so ignition timing can be advanced or retarded for a specific cylinder.
The burining of fuel and air mixture expands in different rates depending on altitude, octane and heat. The change of ignition timing is to comphensate for burn rate so that the maximum combustion pressure occurs about 45° ATDC (after top dead center) for maximum power.
A good example of slower and faster burn rate is when riding a bicycle. When trying to accelerate on a bike, you try and step on hard when the pedal reaches40° ATDC. In theory on a 91 oct. you continue to feed your weight on the pedal until it almost hits the bottom or 40° BBDC (before bottom dead center). While on 87 oct. which also has maxium cylinder pressure at 40° may already burn itself out sooner at 50° BBDC.
Octane requirements varies greatly on engine bore, stroke, combustion chamber design, the amount of EGR (exhaust gas recirculation) and how the fuel is introduced to the camber. The Toyota Prius runs a 13.5:1 and only requires 87 oct. and the new IS350 and 250 have 11.8:1 and 12.1:1 compression ratios and only requires premium but I think it the IS350 may make more power with race gas.
Back to the 2UZ-FE, I have no doubt 91 is capable of making more power than 87 on our engines, but the gains maybe marginal due to lower compression ratio. But I would definitly be putting 91 if I tow. Just my .02 cents.
Charleston