It is always faster to access a local var than having to access it through another function or class.
It doesn't affect the performance on a pc too much, but on mobile devices, if you're using it heavily, there will be a performance slowdown.
I wouldn't suggest option 3, because you are creating a whole new instance of Object A just to access array M[ ] [ ], and that wastes space.
And it always depends on what you are trying to achieve. If you only update the var in class A at certain intervals, 2 would be quicker. If each and every time you modify the variable, you have to let class A know about it by calling another method, it might (i think) be faster to just make it static like in option 1.
There are multiple ways to increase code speed and reduce the size. Here are a few I can think of for now.
Use alot less object orientation. Create as few classes and methods as possible. Each time you call a method, you incur overhead.
So if you are only using a block of code (that resides in a method) say... only in 2 different places, just cut and paste the code where you need it and opt for the redundancy. Especially avoid calling methods within long for() loops. Move the code into the loop itself. Even something simple as having to call array.size() each time within the loop is inefficient. Store it in a local variable before entering loop.
Avoid use of short methods (ie. get() and set() methods) if possible because the overhead of calling it takes up most of the execution time.
Try to reuse your vars as much as possible. ie. If you are creating a new var each time within a loop, create it outside the loop and just keep reusing it. It's easier on the garbage collector.
And of course, since you're doing multiple calculations, using the simple java optimization techniques will work.
Here are a couple of threads with good input from the forum users about midlet optimization.