Every once in a while I see the question how fast an Arduino might be able to toggle some pin
The frequency of the PWM signal is approximately 490 Hz.
This question is trivial if you allow PWM (8 MHz) or even refusing (16 MHz).
PWN is a Duty Cycle output - Meaning it is On for some portion of the time based on a ratio of N/256. It is fixed frequency and thus fixed speed.
If you want to be able to do some function with a 328 or any other processor you need to look into assembly language. You can eliminate teh transfers to RAM by keeping everything in registers (its still RAM, but its faster code...) minimal use of subroutine calls and minimal pushes and pops. The fewer instructions the faster.