As far as I understand it, thats the basics of it
@fiat500.
Short answer: Increasing the compression ratio will increase power across the whole rev range, and help negate any losses in the mid range caused by the higher performance cam. You can safely incase the compression ratio further with a performance cam than with a standard cam.
Long answer:
The longer valve open time, does mean that there is more time when the intake valve is open after the piston starts it's compression stoke. It also means that there is a longer period of 'overlap' when the exhaust valve stays open whilst the inlet valve starts to open early.
At high RPM two elements means that this extended valve open time helps the cylinders fill better. Firstly the higher the RPM the more limited that time for air to flow in, and if you closed the intake valve when the piston reached the bottom of the the intake stroke there would still be a vacuum inside the cylinder. With the extended opening time, even though the piston is starting to rise there is still vacuum inside the engine and so keeping the valve open allows more air to flow in. Secondly, running at high RPM the air in the intake port has higher speed and has some momentum, which can mean it will still flow into the cylinder even a little after the pressure inside becomes equal to the atmosphere.
Neither of these things help at lower RPM though. At low RPM though, where the air speed is slower and there's more time for the pressure to equalise, then there's a chance that with a long overlap som of the fresh air coming in will go straight out of the exhaust before the valve closes, and then also possible that as the piston rises on the compression stroke it will start to push air back out of the inlet valve before it closes.
This will mean that if you put a performance cam on a standard compression engine that it may gain some peak power, but loose across the mid range possibly even to the point of feeling slower in the real world.
We measure how efficiently the cylinders are filling with air using 'volumentic efficiency' or VE. This is the percentage of the cylinder capacity that is filled with fresh air and fuel. The VE curve roughly matches the torque curve (and is essentially directly related). The performance cam will allow for better VE at high RPM, which is how it makes more power, but will have a lower peak VE in the mid and low range due to the air flow issues described above.
Now this is where it get's complicated....
There are two types of compression ratio, static compression ratio and dynamic compression ratio. The static compression ratio is what we quote most of the time, 7.1:1 in a standard 500. We calculate this by comparing the cylinder volume at BDC, in this case 250cc per cylinder, to the volume in the cylinder when the piston is at TDC, ~35cc. 250:35 = 7.1:1.
The dynamic compression rate is an estimate of what the 'real' world compression is taking into account the fact that the cylinders do not always complete fill with fresh air and fuel. A good naturally aspirated engine will work at 85% VE at peak torque, so in the case of our example 250cc cylinder, that means we put 213cc of air and fuel in per stroke. If you do the same calculation on this air volume we will see the dynamic compression is ~6.1:1.
Why does this matter? Higher compression ratio = more power, but it also increases the chance of uncontrolled burning/explosion of the fuel, 'detonation' 'knocking' 'pinging' etc. The limit where detonation is a risk is based upon the dynamic compression, not the static compression.
So with a performance cam we will have a lower peak VE, which means a lower peak dynamic compression, so we can safely increase the static compression ratio. This will bring our dynamic compression back up to a similar level as it was on the standard cam and so in turn bring our mid range back to where it was originally. It has the added bonus of making the engine even more powerful at the high RPM than the cam alone would do.
As a real world reference as to how cam timing allows for different static compression ratios safely, most car engines would consider a compression ratio of 9.5:1 or less 'safe', where their cam timing is based upon revving to 6-7,000 rpm. But a high revving super bike engine will safely run a 13:1 static compression ratio, as its very aggressive cam timing to allow it to rev to 15,000rpm makes it so inefficient at low RPM that the dynamic compression is much lower than even our old little 500 engine.
As an aside, the other limiting factor for safe compression ratio is fuel octane, the amount it resists detonation. The 500 was designed for a time of poor quality fuel, and so even a stock engine will take a reasonable compression ratio bump above the stock 7.1 / 7.5:1 without any problems when run on modern 95+ octane fuel, and with that comes some performance increase.