Chosen Solution

On my macbook air. The top keys of letters are really slow to respond. Sometime it takes really long time! All other keys work.

The keyboard response differs depending on what you are using for an app. As an example filling in a form online can be slow as the connection is either not stable or over a slow link. But the keys across the keyboard should respond the same. Here you are stating a sub set of keys react oddly, I’m suspecting your battery is pressing on the keyboards cable which is interfering with the signal. To prove it you should see a difference between your systems keyboard vs an external keyboard either a Bluetooth or USB connected. I would install this gem of an app! CoconutBattery take a snapshot of the apps main window and post it here for us to see Adding images to an existing question so we can see what the batteries state is.